server_optimize
This commit is contained in:
parent
1e934fe66a
commit
def8040230
1 changed files with 7 additions and 7 deletions
14
server_optimize.sh
Normal file → Executable file
14
server_optimize.sh
Normal file → Executable file
|
@ -94,15 +94,15 @@ function dailyupdates() {
|
|||
|
||||
apt install fcron -y
|
||||
|
||||
echo "#!/bin/bash" >> /etc/cron.daily/update-packages
|
||||
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 "ROOT" >> /etc/cron.daily/update-packages
|
||||
echo "EXITVALUE=\$?" >> /etc/cron.daily/update-packages
|
||||
echo "if [ \$EXITVALUE != 0 ]; then" >> $/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
|
||||
echo "fi" >> /etc/cron.daily/update-packages
|
||||
echo "exit \$EXITVALUE" >> /etc/cron.daily/update-packages
|
||||
chmod +x /etc/cron.daily/update-packages
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue