From c121b24da5466a699e24cbf013d3b23cc24eebd8 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 21 Jul 2023 21:33:53 +0200 Subject: [PATCH] echo --- app.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app.sh b/app.sh index 9c126b4..0910681 100644 --- a/app.sh +++ b/app.sh @@ -1,7 +1,7 @@ #!/bin/bash while true ; do - # Checks + echo "check variables..." if [ -z "$INTERVAL" ] ; then echo "INTERVAL is not set." exit 3 @@ -40,8 +40,7 @@ while true ; do git config --global user.email "$GIT_USER_MAIL" git config --global user.name "$GIT_USERNAME" - echo clone - pwd + echo "clone repository..." GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $GIT_REPO_DEPLOY_KEY" git clone "$GIT_REPO_URL" "$GIT_REPO_PATH" --quiet &> /dev/null cd "$GIT_REPO_PATH" @@ -60,20 +59,16 @@ while true ; do echo "Error: can not export $FQDN config" exit 2 fi - echo "export $FQDN config" + echo "export $FQDN config..." ssh -n -o StrictHostKeyChecking=no -i "$SSH_KEY_PATH" "${USERNAME}@${FQDN}" "/export show-sensitive" > "config_${FQDN}.rsc" 2> /dev/null # entferne Datumszeile - echo sed - pwd sed -i -r '/^# [0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{2}\:[0-9]{2}\:[0-9]{2}\sby\sRouterOS\s[0-9\s\.]+/d' "config_${FQDN}.rsc" - echo add - pwd git add "config_${FQDN}.rsc" - echo commit - pwd + echo "commit config for ${FQDN} ..." git commit -m "update config_${FQDN}" --quiet done <<< "$DEVICES" + echo "push config(s)..." GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $GIT_REPO_DEPLOY_KEY" git push &> /dev/null # Restore the original IFS value