From df0b656f94b6b78e0ce4239a6d36318d77c7f51b Mon Sep 17 00:00:00 2001 From: Manevolent Date: Tue, 18 May 2021 17:48:02 -0600 Subject: [PATCH] If statement problems --- run.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/run.sh b/run.sh index 287d53c..949f6ec 100644 --- a/run.sh +++ b/run.sh @@ -4,15 +4,15 @@ version_file=/etc/lixonet/version while true do { - current_version=`cat $version_file || echo 0` - git fetch - latest_commit=`git log "--format=%G? %H" | grep ^G | head -n 1 | cut -d' ' -f2` - git checkout $latest_commit - checkout_version=`cat version` + current_version=`cat $version_file || echo 0` && + git fetch && + latest_commit=`git log "--format=%G? %H" | grep ^G | head -n 1 | cut -d' ' -f2` && + git checkout $latest_commit && + checkout_version=`cat version` && if [ "$checkout_version" -gt "$current_version" ]; then - echo "Updating to version $checkout_version..." - chmod +x build.sh && ./build.sh - echo "Updated to version $checkout_version." + echo "Updating to version $checkout_version..." && + chmod +x build.sh && ./build.sh && + echo "Updated to version $checkout_version." && echo $checkout_version > $version_file fi } || {