From d68088d38298de0a4f92269b3b05478e8a1818cc Mon Sep 17 00:00:00 2001 From: hockeygoalie35 Date: Sun, 11 Feb 2024 14:11:33 -0500 Subject: [PATCH] Add check for arlUpdateInterval var. fallback to 24h --- lidarr/ARLChecker | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lidarr/ARLChecker b/lidarr/ARLChecker index 2af94fe..5e43dc9 100644 --- a/lidarr/ARLChecker +++ b/lidarr/ARLChecker @@ -1,11 +1,22 @@ #!/usr/bin/with-contenv bash -scriptVersion="0.1" +### Default values +scriptVersion="1.1" scriptName="ARLChecker" - +sleepInterval='24h' ### Import Settings source /config/extended.conf echo Starting ARL Token Check... -python /custom-services.d/python/ARLChecker.py -c -echo ARL Token Check Complete. Sleeping for 24hrs... -sleep "$arlUpdateInterval" \ No newline at end of file +python /custom-services.d/python/ARLChecker.py -c # run py script + +# If variable doesn't exist, or not set by user in extended.conf, fallback to 24h +# See issue #189 +if [[ -v arlUpdateInterval ]] && [ "$arlUpdateInterval" != "" ];then + echo 'conf' + sleepInterval="$arlUpdateInterval" +else + echo 'default' +fi + +echo ARL Token Check Complete. Sleeping for ${sleepInterval}. +sleep ${sleepInterval} \ No newline at end of file