summaryrefslogtreecommitdiffstats
path: root/etc/periodic/security/200.chkmounts
diff options
context:
space:
mode:
Diffstat (limited to 'etc/periodic/security/200.chkmounts')
-rwxr-xr-xetc/periodic/security/200.chkmounts24
1 files changed, 5 insertions, 19 deletions
diff --git a/etc/periodic/security/200.chkmounts b/etc/periodic/security/200.chkmounts
index dbd2907..3b72c52 100755
--- a/etc/periodic/security/200.chkmounts
+++ b/etc/periodic/security/200.chkmounts
@@ -38,35 +38,21 @@ then
source_periodic_confs
fi
-LOG="${daily_status_security_logdir}"
+. /etc/periodic/security/security.functions
+
ignore="${daily_status_security_chkmounts_ignore}"
rc=0
case "$daily_status_security_chkmounts_enable" in
[Yy][Ee][Ss])
- TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX`
case "$daily_status_security_noamd" in
[Yy][Ee][Ss])
ignore="${ignore}|^amd:"
esac
[ -n "$ignore" ] && cmd="egrep -v ${ignore#|}" || cmd=cat
- if mount -p | ${cmd} > ${TMP}; then
- if [ ! -f ${LOG}/mount.today ]; then
- rc=1
- echo ""
- echo "No ${LOG}/mount.today"
- cp ${TMP} ${LOG}/mount.today || rc=3
- fi
- if ! cmp ${LOG}/mount.today ${TMP} >/dev/null 2>&1; then
- [ $rc -lt 1 ] && rc=1
- echo ""
- echo "${host} changes in mounted filesystems:"
- diff -b ${LOG}/mount.today ${TMP}
- mv ${LOG}/mount.today ${LOG}/mount.yesterday || rc=3
- mv ${TMP} ${LOG}/mount.today || rc=3
- fi
- fi
- rm -f ${TMP};;
+ mount -p | ${cmd} |
+ check_diff mount - "${host} changes in mounted filesystems:"
+ rc=$?;;
*) rc=0;;
esac
OpenPOWER on IntegriCloud