From 4aaeff02c72e1e3b76fcb72148204b21e1f9fa78 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Tue, 14 Jun 2022 07:05:44 -0400 Subject: [PATCH] Create 98-script-setup.bash --- root/etc/cont-init.d/98-script-setup.bash | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 root/etc/cont-init.d/98-script-setup.bash diff --git a/root/etc/cont-init.d/98-script-setup.bash b/root/etc/cont-init.d/98-script-setup.bash new file mode 100644 index 0000000..82eee10 --- /dev/null +++ b/root/etc/cont-init.d/98-script-setup.bash @@ -0,0 +1,38 @@ +#!/usr/bin/with-contenv bash + +# create scripts directory if missing +if [ ! -d "/config/lidarr-extended/scripts" ]; then + mkdir -p "/config/lidarr-extended/scripts" +else + echo "Updating scripts..." + rm -rf /config/lidarr-extended/scripts/* +fi + +if [ -d "/config/lidarr-extended/scripts" ]; then + cp -r /scripts/* /config/lidarr-extended/scripts/ +fi + +# create cache directory if missing +if [ ! -d "/config/lidarr-extended/cache" ]; then + mkdir -p "/config/lidarr-extended/cache" +fi + +# create logs directory if missing +if [ ! -d "/config/lidarr-extended/logs" ]; then + mkdir -p "/config/lidarr-extended/logs" +fi + + +# set permissions +chmod 777 "/config/lidarr-extended" +chmod 777 "/config/lidarr-extended/scripts" +chmod 777 "/config/lidarr-extended/cache" +chmod 777 "/config/lidarr-extended/logs" +chown -R abc:abc "/config/lidarr-extended" +chown -R abc:abc "/config/lidarr-extended/cache" +chown -R abc:abc "/config/lidarr-extended/scripts" +chown -R abc:abc "/config/lidarr-extended/logs" + +echo "Complete..." + +exit $?