mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-24 15:00:31 +02:00
Update and rename 99_store_user to 30_define_user
This commit is contained in:
20
nextcloud/root/etc/cont-init.d/30_define_user
Normal file
20
nextcloud/root/etc/cont-init.d/30_define_user
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
bashio::log.info "Checking permissions..."
|
||||||
|
PUID=$(bashio::config "PUID")
|
||||||
|
PGID=$(bashio::config "PGID")
|
||||||
|
OLDPUID=""
|
||||||
|
OLDPGID=""
|
||||||
|
if [ -f /data/puid ] && [ -f /data/pgid ]; then
|
||||||
|
OLDPUID=$(cat /data/puid)
|
||||||
|
OLDPGID=$(cat /data/pgid)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$OLDPUID" != "$PUID" ] && [ "$OLDPGID" != "$PGID" ]; then
|
||||||
|
bashio::log.info "... the user has changed from ${OLDPUID}:${OLDPGID} to ${PUID}:${PGID} ..."
|
||||||
|
/defaults/nextcloud-perms.sh
|
||||||
|
fi
|
||||||
|
bashio::log.info "... done"
|
||||||
|
|
||||||
|
#storing user id
|
||||||
|
echo "$(bashio::config "PUID")" > "/data/puid"
|
||||||
|
echo "$(bashio::config "PGID")" > "/data/pgid"
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
|
||||||
|
|
||||||
#storing user id
|
|
||||||
echo "$(bashio::config "PUID")" > "/data/puid"
|
|
||||||
echo "$(bashio::config "PGID")" > "/data/pgid"
|
|
||||||
Reference in New Issue
Block a user