From 7221b66af5193a3eca1b52fe39cdf47e75354270 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 21 Jul 2023 21:36:27 +0200 Subject: [PATCH] reihenflge --- app.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app.sh b/app.sh index 0910681..66b6211 100644 --- a/app.sh +++ b/app.sh @@ -1,6 +1,18 @@ #!/bin/bash + GIT_REPO_PATH=$(mktemp -d) + + git config --global user.email "$GIT_USER_MAIL" + git config --global user.name "$GIT_USERNAME" + + 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" + while true ; do + echo "pull repository..." + git pull --quiet &> /dev/null + echo "check variables..." if [ -z "$INTERVAL" ] ; then echo "INTERVAL is not set." @@ -35,15 +47,6 @@ while true ; do exit 3 fi - GIT_REPO_PATH=$(mktemp -d) - - git config --global user.email "$GIT_USER_MAIL" - git config --global user.name "$GIT_USERNAME" - - 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" - # Save the current value of IFS to restore later OLD_IFS=$IFS