mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 05:44:03 +02:00
Avoid root as user
https://github.com/alexbelgium/hassio-addons/issues/1197
This commit is contained in:
@@ -31,6 +31,18 @@ for k in $(bashio::jq "/data/options.json" 'keys | .[]'); do
|
|||||||
export "$k"="$(bashio::config "$k")"
|
export "$k"="$(bashio::config "$k")"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
##############
|
||||||
|
# Check PUID #
|
||||||
|
##############
|
||||||
|
|
||||||
|
bashio::log.info "Checking user type"
|
||||||
|
if [ "$PUID" = 0 ] || [ "$PGID" = 0 ]; then
|
||||||
|
bashio::log.warning "Can't run as root, the user will be set to 1000:1000"
|
||||||
|
bashio::addon.option "PUID" "1000"
|
||||||
|
bashio::addon.option "PGID" "1000"
|
||||||
|
bashio::addon.restart
|
||||||
|
fi
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# CONFIG YAML #
|
# CONFIG YAML #
|
||||||
###############
|
###############
|
||||||
|
|||||||
Reference in New Issue
Block a user