diff --git a/upgradeAll.sh b/upgradeAll.sh index e6067dd0502f719674565f52558d82468b283095..b310d21a731a827af447f20923c932cd0240228a 100644 --- a/upgradeAll.sh +++ b/upgradeAll.sh @@ -54,22 +54,22 @@ fi # install monit if not installed if [ -z "$(dpkg -l | grep ' monit ')" ]; then apt-get update && apt-get install -y monit - - # Monit all partition without swap and boot - list_of_part=(`grep -v "#\|swap\|noauto" /etc/fstab | awk '{print $2}'`) - echo "" > ./result - for part in "${list_of_part[@]}" - do - echo -e "check device root with path $part\n if SPACE usage > 75% then alert\nif SPACE usage > 75% timeout 86400 seconds then alert\n\n" >> ./result - done - ln -s /etc/monit/conf-available/disc /etc/monit/conf-enabled/ sed -i 's/# set httpd/set httpd/' /etc/monit/monitrc sed -i 's/^# allow localhost/ allow localhost/' /etc/monit/monitrc echo -e "set mailserver 127.0.0.1\nset mail-format { from: Monit <monit@$DOMAIN>}\nset alert root@localhost" >> /etc/monit/monitrc - systemctl restart monit fi +# Monit all partition without swap and boot +list_of_part=(`grep -v "#\|swap\|noauto" /etc/fstab | awk '{print $2}'`) +echo "" > ./$$-parts +for part in "${list_of_part[@]}" +do + echo -e "check device root with path $part\n if SPACE usage > 75% then alert\nif SPACE usage > 75% timeout 86400 seconds then alert\n\n" >> ./$$-parts +done +mv ./$$-parts /etc/monit/conf-available/disc +systemctl restart monit + # Check rootkits and antivirus if [ `grep -c "^ALLOWHIDDENDIR=/etc/.java" /etc/rkhunter.conf` -eq 0 ] then