Skip to content

Commit

Permalink
Update kafka-builder.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
allamiro authored May 12, 2024
1 parent 91892cc commit 832d9c7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions DpipelineBuilder/kafka-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ if [ ! -f "$SERVER_FILE" ]; then
exit 1
fi

# Loop through each server listed in the file and execute the update command
# Loop through each server listed in the file
while read -r server; do
if [ -z "$server" ]; then
continue # skip empty lines
fi
echo "Updating files on $server..."
ssh "$server" "$UPDATE_COMMAND"
echo "Connecting to $server..."
ssh "$server" <<- 'SSHCOMMANDS'
echo "Appending text to a file..."
echo "Sample text" >> /path/to/remote/file.txt
echo "Listing directory contents..."
ls -l /path/of/interest
echo "Checking disk usage..."
df -h
echo "Updating system packages..."
sudo apt-get update && sudo apt-get upgrade -y
SSHCOMMANDS
done < "$SERVER_FILE"

0 comments on commit 832d9c7

Please sign in to comment.