Initial commit

This commit is contained in:
2026-04-19 21:43:13 +07:00
commit b66b6589c8
6 changed files with 1206 additions and 0 deletions
Executable
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# Function to run SSH command and handle errors
run_ssh() {
server=$1
command=$2
echo "===== $server ====="
ssh -T $server "$command" &
# Capture the PID of the last background process
pid=$!
# Wait for the background process to finish
wait $pid
# Check the exit status of the background process
if [ $? -eq 0 ]; then
echo "Successfully upgraded $server."
else
echo "Failed to upgrade $server. Check the connection and try again."
fi
}
# Run SSH commands for each server
run_ssh "oc" 'sudo apt-get upgrade -y'
run_ssh "tk" 'sudo apt-get upgrade -y'
run_ssh "cc" 'sudo apt-get upgrade -y'
run_ssh "rpi3" 'sudo apt-get upgrade -y'
run_ssh "cse-z" 'sudo apt-get upgrade -y'
run_ssh "hp" 'sudo apt-get upgrade -y'
run_ssh "od-xu4" 'yay'
echo "Upgrade process completed for all servers."