From f2aca49cdceacedbafee95b73b99f2085ed244da Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 7 Jul 2023 14:13:14 -0400 Subject: [PATCH] Update setup.bash --- sabnzbd/setup.bash | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/sabnzbd/setup.bash b/sabnzbd/setup.bash index ca9d6ea..82e92dd 100644 --- a/sabnzbd/setup.bash +++ b/sabnzbd/setup.bash @@ -1,5 +1,5 @@ #!/usr/bin/with-contenv bash -scriptVersion="1.1" +scriptVersion="1.2" ######## Package dependencies installation InstallRequirements () { @@ -31,8 +31,30 @@ InstallRequirements mkdir -p /config/scripts chmod 777 /config/scripts echo "Downloading SMA config: /config/scripts/sma.ini" -curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/sma.ini" -O /config/scripts/sma.ini +curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/sma.ini" -O /config/sma.ini +if [ -f /config/sma.ini ]; then + if [ -f /config/scripts/sma.ini ]; then + echo "Removing /config/scripts/sma.ini" + rm /config/scripts/sma.ini + fi + echo "Importing /config/sma.ini to /config/scripts/sma.ini" + mv /config/video.bash /config/scripts/sma.ini + chmod 777 /config/scripts/sma.ini +fi + echo "Downloading Video script config: /config/scripts/video.bash" -curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/video.bash" -O /config/scripts/video.bash +curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/video.bash" -O /config/video.bash + +if [ -f /config/video.bash ]; then + if [ -f /config/scripts/video.bash ]; then + echo "Removing /config/scripts/video.bash" + rm /config/scripts/video.bash + fi + echo "Importing /config/sma.ini to /config/scripts/video.bash" + mv /config/video.bash /config/scripts/video.bash + chmod 777 /config/scripts/video.bash +fi + + chmod 777 -R /config/scripts exit