„runupdate“ ändern

This commit is contained in:
Yann Mölle 2023-04-19 19:58:46 +02:00
parent 45bce45f0d
commit 2897eb5be2

View File

@ -13,12 +13,12 @@ user=root
# Function to check for updates on a remote server
check_updates () {
ssh $user@$1 "sudo apt-get update > /dev/null && apt list --upgradable"
ssh $user@$1 "apt-get update > /dev/null && apt list --upgradable"
}
# Function to update a remote server
update_server () {
ssh $user@$1 "sudo apt-get update > /dev/null && sudo apt-get upgrade -y" > /dev/null 2>&1
ssh $user@$1 "apt-get update > /dev/null && apt-get upgrade -y" > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Update successful on $1"
elif [ -n "$updates" ]; then