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