mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-13 19:31:01 +01:00
21 lines
595 B
Plaintext
21 lines
595 B
Plaintext
#!/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"
|