From 91892cc7d852714dfbcdf6affa3fcd687b6cc7ee Mon Sep 17 00:00:00 2001 From: Tamir Suliman Date: Sun, 12 May 2024 03:12:32 +0200 Subject: [PATCH] Update kafka-builder.sh --- DpipelineBuilder/kafka-builder.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/DpipelineBuilder/kafka-builder.sh b/DpipelineBuilder/kafka-builder.sh index 8b13789..0bbf92a 100644 --- a/DpipelineBuilder/kafka-builder.sh +++ b/DpipelineBuilder/kafka-builder.sh @@ -1 +1,16 @@ +#!/bin/bash +SERVER_FILE="servers.txt" +# Check if the server file exists +if [ ! -f "$SERVER_FILE" ]; then + echo "Error: Server file not found!" + exit 1 +fi +# Loop through each server listed in the file and execute the update command +while read -r server; do + if [ -z "$server" ]; then + continue # skip empty lines + fi + echo "Updating files on $server..." + ssh "$server" "$UPDATE_COMMAND" +done < "$SERVER_FILE"