Chown legacy custom locations if they exist

This commit is contained in:
TheSpad 2022-06-09 11:51:13 +01:00
parent 32e37c440b
commit ec6eed279d
No known key found for this signature in database
GPG key ID: 08F06191F4587860

View file

@ -6,6 +6,15 @@ SERVICES_DIR_OLD="/config/custom-services.d"
SCRIPTS_DIR="/custom-cont-init.d" SCRIPTS_DIR="/custom-cont-init.d"
SERVICES_DIR="/custom-services.d" SERVICES_DIR="/custom-services.d"
# chown legacy folders if they exist
if [ -e "${SCRIPTS_DIR_OLD}" ]; then
chown -R 0:0 "${SCRIPTS_DIR_OLD}"
fi
if [ -e "${SERVICES_DIR_OLD}" ]; then
chown -R 0:0 "${SERVICES_DIR_OLD}"
fi
# Remove all existing custom services before continuing to ensure # Remove all existing custom services before continuing to ensure
# we aren't running anything the user may have removed # we aren't running anything the user may have removed
if [ -n "$(/bin/ls -A /etc/services.d/custom-service-* 2>/dev/null)" ]; then if [ -n "$(/bin/ls -A /etc/services.d/custom-service-* 2>/dev/null)" ]; then