From f3c29283e332b0f6c63be3b46268b3f09d05f30a Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Tue, 8 Nov 2022 08:30:23 -0500 Subject: [PATCH] 1.0.4 - Only run 1 time, unless log file is deleted #27 --- root/scripts/AutoConfig.bash | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/root/scripts/AutoConfig.bash b/root/scripts/AutoConfig.bash index 5d0b220..ca05cad 100644 --- a/root/scripts/AutoConfig.bash +++ b/root/scripts/AutoConfig.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.3" +scriptVersion="1.0.4" if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then arrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -26,6 +26,13 @@ log () { echo $m_time" :: AutoConfig :: $scriptVersion :: "$1 } +if [ -f /config/extended/logs/autoconfig ]; then + log "Radarr previously configured with optimal settings, skipping..." + log "To re-configure Radarr, delete the following file:" + log "/config/extended/logs/autoconfig" + exit +fi + log "Getting Trash Guide Recommended Movie Naming..." movieNaming="$(curl -s https://raw.githubusercontent.com/TRaSH-/Guides/master/docs/Radarr/Radarr-recommended-naming-scheme.md | grep "{Movie Clean" | head -n 1)" @@ -91,4 +98,7 @@ else updateArr=$(curl -s "$arrUrl/api/v3/notification?" -X POST -H "Content-Type: application/json" -H "X-Api-Key: ${arrApiKey}" --data-raw '{"onGrab":false,"onDownload":true,"onUpgrade":true,"onRename":true,"onMovieAdded":false,"onMovieDelete":false,"onMovieFileDelete":false,"onMovieFileDeleteForUpgrade":false,"onHealthIssue":false,"onApplicationUpdate":false,"supportsOnGrab":true,"supportsOnDownload":true,"supportsOnUpgrade":true,"supportsOnRename":true,"supportsOnMovieAdded":true,"supportsOnMovieDelete":true,"supportsOnMovieFileDelete":true,"supportsOnMovieFileDeleteForUpgrade":true,"supportsOnHealthIssue":true,"supportsOnApplicationUpdate":true,"includeHealthWarnings":false,"name":"MovieExtras.bash","fields":[{"name":"path","value":"/config/extended/scripts/MovieExtras.bash"},{"name":"arguments"}],"implementationName":"Custom Script","implementation":"CustomScript","configContract":"CustomScriptSettings","infoLink":"https://wiki.servarr.com/radarr/supported#customscript","message":{"message":"Testing will execute the script with the EventType set to Test, ensure your script handles this correctly","type":"warning"},"tags":[]}') log "Complete" fi + +touch /config/extended/logs/autoconfig +chmod 666 /config/extended/logs/autoconfig exit