reihenflge

This commit is contained in:
Michael Grote 2023-07-21 21:36:27 +02:00
parent c121b24da5
commit 7221b66af5

21
app.sh
View file

@ -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