From ce74136bcfaf89011dea6c0db1c93cc0f602e6df Mon Sep 17 00:00:00 2001 From: "Stian Larsen (lonix)" Date: Tue, 13 Oct 2015 13:15:15 +0200 Subject: [PATCH] Fixed a lot of minor code errors --- init/40_install_or_update.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/init/40_install_or_update.sh b/init/40_install_or_update.sh index 66ec93d..5782af3 100644 --- a/init/40_install_or_update.sh +++ b/init/40_install_or_update.sh @@ -13,20 +13,19 @@ curl -o /tmp/json http://nzbget.net/info/nzbget-version-linux.json #Grabbing relevant data out of json -TESTING_VERSION=$() -if [ $TESTING ]; then +if [ "$TESTING" ]; then echo "Useing TESTING branch:" - REMOTE_VERSION=$(cat /tmp/json | grep testing-version | cut -d '"' -f 4) - DOWNLOAD=$(cat /tmp/json | grep testing-download | cut -d '"' -f 4) + REMOTE_VERSION=$(grep testing-version -f /tmp/json | cut -d '"' -f 4) + DOWNLOAD=$(grep testing-download -f /tmp/json | cut -d '"' -f 4) else echo "Useing STABLE Branch:" - REMOTE_VERSION=$(cat /tmp/json | grep stable-version | cut -d '"' -f 4) - DOWNLOAD=$(cat /tmp/json | grep stable-download | cut -d '"' -f 4) + REMOTE_VERSION=$(grep stable-version -f /tmp/json | cut -d '"' -f 4) + DOWNLOAD=$(grep stable-download -f /tmp/json | cut -d '"' -f 4) fi -if [ $LOCAL_VERSION != $REMOTE_VERSION ]; then +if [ "$LOCAL_VERSION" != "$REMOTE_VERSION" ]; then echo "Not up-to-date\Installed" - wget -O /tmp/nzbget.run $DOWNLOAD + wget -O /tmp/nzbget.run "$DOWNLOAD" /sbin/setuser abc sh /tmp/nzbget.run --destdir /app if [ -x /app/nzbget ]; then echo "Install successfull"; fi fi