forked from evolix/evocheck
Compare commits
2 commits
master
...
11-Check-f
Author | SHA1 | Date | |
---|---|---|---|
Benoît S. | 0c41b7a0fd | ||
Benoît S. | eeef449f55 |
21
evocheck.sh
21
evocheck.sh
|
@ -107,6 +107,7 @@ IS_EVOACME_LIVELINKS=1
|
|||
IS_APACHE_CONFENABLED=1
|
||||
IS_MELTDOWN_SPECTRE=1
|
||||
IS_OLD_HOME_DIR=1
|
||||
IS_HOME_SIZE=1
|
||||
|
||||
#Proper to OpenBSD
|
||||
IS_SOFTDEP=1
|
||||
|
@ -886,6 +887,26 @@ if [ -e /etc/debian_version ]; then
|
|||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$IS_HOME_SIZE" = 1 ]; then
|
||||
# Can be changed in evocheck.cf
|
||||
homeDir=${homeDir:-/home}
|
||||
homeMaxSize=${homeMaxSize:-1048576}
|
||||
# If the user has an evomaintenance profile trap he is
|
||||
# considered a sysadmin
|
||||
for homeProfile in ${homeDir}/*/.profile; do
|
||||
if grep -q "evomaintenance.sh" "$homeProfile"; then
|
||||
homeSize=$(du -s "${homeProfile%%.profile}" \
|
||||
| awk '{print $1}')
|
||||
homeUser=$(stat "$homeProfile" -c %U)
|
||||
if [ "$homeSize" -gt "$homeMaxSize" ]; then
|
||||
echo 'IS_HOME_SIZE FAILED!'
|
||||
verbose "User $homeUser has more than 1G in his home" \
|
||||
|| break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue