From f8a636182830213a1d8574175cda7cc9d2c4afec Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Wed, 12 Jul 2023 12:47:29 +0000 Subject: [PATCH] v1.1 make configurable --- radarr/AutoExtras.service | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/radarr/AutoExtras.service b/radarr/AutoExtras.service index e0f936c..dbec4e7 100644 --- a/radarr/AutoExtras.service +++ b/radarr/AutoExtras.service @@ -1,5 +1,20 @@ #!/usr/bin/env bash -scriptVersion="1.0" +scriptVersion="1.1" +scriptName="AutoExtras" + +#### Import Settings +source /config/extended.conf + +log () { + m_time=`date "+%F %T"` + echo $m_time" :: $scriptName :: $scriptVersion :: "$1 +} + +if [ "$enableExtras" != "true" ]; then + log "Script is not enabled, enable by setting enableExtras to \"true\" by modifying the \"/config/extended.conf\" config file..." + log "Sleeping (infinity)" + sleep infinity +fi getArrAppInfo () { # Get Arr App information @@ -37,11 +52,6 @@ verifyApiAccess () { done } -log () { - m_time=`date "+%F %T"` - echo $m_time" :: AutoExtras :: $scriptVersion :: "$1 -} - AutoExtrasProcess () { # auto-clean up log file to reduce space usage @@ -68,13 +78,13 @@ AutoExtrasProcess () { } -echo "Starting Script...." +log "Starting Script...." for (( ; ; )); do let i++ getArrAppInfo verifyApiAccess AutoExtrasProcess - echo "Script sleeping for 24 hours..." + log "Script sleeping for 24 hours..." sleep 24h done