diff --git a/.templates/ha_entrypoint_modif.sh b/.templates/ha_entrypoint_modif.sh index a6e68246c..1354f9a9c 100755 --- a/.templates/ha_entrypoint_modif.sh +++ b/.templates/ha_entrypoint_modif.sh @@ -8,15 +8,26 @@ set -e # Corrects permissions for s6 v3 ################################ +PUID="{PUID:-0}" +PGID="{PGID:-0}" + +if [ -f /ha_entrypoint.sh ]; then + chown -R "$PUID:$PGID" /ha_entrypoint.sh + chmod -R 755 /ha_entrypoint.sh +fi + if [ -d /etc/cont-init.d ]; then + chown -R "$PUID:$PGID" /etc/cont-init.d chmod -R 755 /etc/cont-init.d fi if [ -d /etc/services.d ]; then + chown -R "$PUID:$PGID" /etc/services.d chmod -R 755 /etc/services.d fi if [ -d /etc/s6-rc.d ]; then + chown -R "$PUID:$PGID" /etc/s6-rc.d chmod -R 755 /etc/s6-rc.d fi