File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,20 @@ if [ ! -f "$SERVER_FILE" ]; then
6
6
exit 1
7
7
fi
8
8
9
- # Loop through each server listed in the file and execute the update command
9
+ # Loop through each server listed in the file
10
10
while read -r server; do
11
11
if [ -z " $server " ]; then
12
12
continue # skip empty lines
13
13
fi
14
- echo " Updating files on $server ..."
15
- ssh " $server " " $UPDATE_COMMAND "
14
+ echo " Connecting to $server ..."
15
+ ssh " $server " << - 'SSHCOMMANDS '
16
+ echo "Appending text to a file..."
17
+ echo "Sample text" >> /path/to/remote/file.txt
18
+ echo "Listing directory contents..."
19
+ ls -l /path/of/interest
20
+ echo "Checking disk usage..."
21
+ df -h
22
+ echo "Updating system packages..."
23
+ sudo apt-get update && sudo apt-get upgrade -y
24
+ SSHCOMMANDS
16
25
done < " $SERVER_FILE "
You can’t perform that action at this time.
0 commit comments