Update-Script
Das Script benötigt das Tool needrestart:needrestart:
apt install needrestart
Das Script in die Shell kopieren um es in einedie Datei debianupdate.sh zu übertragen:
cat > /root/debianupdate.sh << EOF
#!/bin/bash
lightblue='\033[1;34m'
lightgreen='\033[1;32m'
lightred='\033[1;31m'
yellow='\033[0;33m'
nocolor='\033[0m'
echo
echo -e "${lightblue}Run command 'apt-get update':${nocolor}"
apt-get update
echo -e "${lightgreen}Command 'apt-get update' finished.${nocolor}"
echo
echo -e "${lightblue}Run command 'apt-get dist-upgrade':${nocolor}"
apt-get dist-upgrade
echo -e "${lightgreen}Command 'apt-get dist-upgrade' finished.${nocolor}"
echo
echo -e "${lightblue}Run command 'apt-get autoremove':${nocolor}"
apt-get autoremove
echo -e "${lightgreen}Command 'apt-get autoremove' finished.${nocolor}"
echo
echo -e "${lightblue}Run command 'apt-get autoclean':${nocolor}"
apt-get autoclean
echo -e "${lightgreen}Command 'apt-get autoclean' finished.${nocolor}"
echo
echo -e "${lightblue}Run command 'needrestart' to check which processes need to be restarted after an upgrade:${nocolor}"
if test -e /usr/sbin/needrestart; then
needrestart
else
echo
echo -e "${yellow}Command 'needrestart' not found, use 'apt install needrestart' to install this feature!${nocolor}"
echo
fi
echo -e "${lightgreen}Update now completed.${nocolor}"
echo
exit 0
EOF
Danach die Berechtigungen ändern:
chmod 500 /root/debianupdate.sh