„runupdate“ ändern
This commit is contained in:
parent
45bce45f0d
commit
2897eb5be2
@ -13,12 +13,12 @@ user=root
|
|||||||
|
|
||||||
# Function to check for updates on a remote server
|
# Function to check for updates on a remote server
|
||||||
check_updates () {
|
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
|
# Function to update a remote server
|
||||||
update_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
|
if [ $? -eq 0 ]; then
|
||||||
echo "Update successful on $1"
|
echo "Update successful on $1"
|
||||||
elif [ -n "$updates" ]; then
|
elif [ -n "$updates" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user