server_optimize

This commit is contained in:
simono41 2019-08-05 13:03:48 +02:00
parent 45c180ac28
commit 1e934fe66a

View file

@ -90,6 +90,22 @@ chmod 755 /opt/shell-login.sh
} }
function dailyupdates() {
apt install fcron -y
echo "#!/bin/bash" >> /etc/cron.daily/update-packages
echo -n "apt update && apt upgrade -y" >> /etc/cron.daily/update-packages
echo "ROOT" >> ${mountpoint}/etc/cron.daily/update-packages
echo "EXITVALUE=\$?" >> ${mountpoint}/etc/cron.daily/update-packages
echo "if [ \$EXITVALUE != 0 ]; then" >> ${mountpoint}/etc/cron.daily/update-packages
echo " /usr/bin/logger -t update-packages \"ALERT exited abnormally with [\$EXITVALUE]\"" >> /etc/cron.daily/update-packages
echo "fi" >> ${mountpoint}/etc/cron.daily/update-packages
echo "exit \$EXITVALUE" >> ${mountpoint}/etc/cron.daily/update-packages
chmod +x ${mountpoint}/etc/cron.daily/update-packages
}
makesshsecure makesshsecure
sleep 1 sleep 1
makeiptables makeiptables
@ -99,3 +115,5 @@ sleep 1
makeuser makeuser
sleep 1 sleep 1
userloginalert userloginalert
sleep 1
dailyupdates