From 5f74fa4033a87970b3eb73ce9aaec82e4116a17c Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Wed, 4 Mar 2020 20:08:39 -0500 Subject: [PATCH] Update 02-script-setup.bash --- root/etc/cont-init.d/02-script-setup.bash | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/02-script-setup.bash b/root/etc/cont-init.d/02-script-setup.bash index e1565ff..186eb03 100644 --- a/root/etc/cont-init.d/02-script-setup.bash +++ b/root/etc/cont-init.d/02-script-setup.bash @@ -2,7 +2,7 @@ # Create scripts directory if [ ! -d "/config/scripts" ]; then - mkdir "/config/scripts" + mkdir -p "/config/scripts" fi # Remove existing LAD start script @@ -17,4 +17,20 @@ if [ ! -f "/config/scripts/AudioPostProcessing.bash" ]; then chmod 0777 "/config/scripts/AudioPostProcessing.bash" fi +# Create downloads incomplete directory +if [ ! -d "/downloads/incomplete" ]; then + mkdir -p "/downloads/incomplete" + chmod 0777 "/downloads/incomplete" +fi + +# Create downloads complete directory +if [ ! -d "/downloads/complete" ]; then + mkdir -p "/downloads/complete" + chmod 0777 "/downloads/incomplete" +fi + +sed -i "s/script_dir = \"\"/script_dir = \"/config\/scripts\"/g" "/config/sabnzbd.ini" && \ +sed -i "s/Downloads\/incomplete/\/downloads\/incomplete/g" "/config/sabnzbd.ini" && \ +sed -i "s/Downloads\/complete/\/downloads\/complete/g" "/config/sabnzbd.ini" + exit 0