From 9d2c7542fc5a18fa54cd9e61aedbe93304431e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20M=C3=B6lle?= Date: Wed, 19 Apr 2023 19:39:10 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9Erunupdate.sh=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runupdate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runupdate.sh b/runupdate.sh index 28bda80..f8b7b07 100644 --- a/runupdate.sh +++ b/runupdate.sh @@ -13,7 +13,7 @@ do echo "Checking for updates on server: ${SERVER}" # Establish SSH connection to remote server and run commands to check for updates - SSH_RESULT=$(ssh root@${SERVER} "sudo apt-get update > /dev/null && apt list --upgradable") + SSH_RESULT=$(ssh username@${SERVER} "sudo apt-get update > /dev/null && apt list --upgradable") # If updates are available, inform the user if [ -n "${SSH_RESULT}" ]; then @@ -37,7 +37,7 @@ if [[ $UPDATE_CONFIRMATION == "Yes" ]]; then echo "Updating server: ${SERVER}" # Establish SSH connection to remote server and run commands to update - ssh root@${SERVER} "sudo apt-get update > /dev/null && sudo apt-get upgrade -y" > /dev/null 2>&1 + ssh username@${SERVER} "sudo apt-get update > /dev/null && sudo apt-get upgrade -y" > /dev/null 2>&1 # Check the return value of ssh to determine if the update was successful if [[ $? -eq 0 ]]; then