]> arthur.barton.de Git - nagcollect.git/commitdiff
nagcollect: do auto-update even when not configured completely
authorAlexander Barton <alex@barton.de>
Wed, 22 Aug 2012 13:59:02 +0000 (15:59 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 22 Aug 2012 13:59:02 +0000 (15:59 +0200)
client/bin/nagcollect

index 71180a11718748a2b3e00a5c9af1b70dcb02976c..bd884c9a302523a758a2dd7e97bd8e7e5f9e2300 100755 (executable)
@@ -58,15 +58,15 @@ function submitService()
 [ -r "/usr/local/etc/nagcollect.conf" ] && . /usr/local/etc/nagcollect.conf
 [ -r "/etc/nagcollect.conf" ] && . /etc/nagcollect.conf
 
 [ -r "/usr/local/etc/nagcollect.conf" ] && . /usr/local/etc/nagcollect.conf
 [ -r "/etc/nagcollect.conf" ] && . /etc/nagcollect.conf
 
-[ -n "$SERVER_URL" -a -n "$CLIENT_KEY" -a -n "$CLIENT_ID" ] || \
-       Error "Configuration invalid, check SERVER_URL, CLIENT_KEY and CLIENT_ID variables!"
-
-if [ "$AUTOUPDATE" = 1 ]; then
+if [ -n "$SERVER_URL" -a "$AUTOUPDATE" = 1 ]; then
        Msg "Updating local test scripts:"
        refreshTestScripts || \
                Error "Failed to refresh test scripts from \"$SERVER_URL\" ($?)!"
 fi
 
        Msg "Updating local test scripts:"
        refreshTestScripts || \
                Error "Failed to refresh test scripts from \"$SERVER_URL\" ($?)!"
 fi
 
+[ -n "$SERVER_URL" -a -n "$CLIENT_KEY" -a -n "$CLIENT_ID" ] || \
+       Error "Can't continue, configuration invalid: check SERVER_URL, CLIENT_KEY and CLIENT_ID variables!"
+
 Msg "Running test scripts:"
 
 ls -1 \
 Msg "Running test scripts:"
 
 ls -1 \