Avoid abc user

This commit is contained in:
Alexandre
2023-03-31 22:05:08 +02:00
parent 0afbaa8163
commit 669bf55835
6 changed files with 35 additions and 25 deletions

View File

@@ -4,6 +4,10 @@
# Only execute if installed
if [ -f /notinstalled ]; then exit 0; fi
# Specify launcher
PUID=$(bashio::config "PUID")
PGID=$(bashio::config "PGID")
# Check current version
if [ -f /data/config/www/nextcloud/version.php ]; then
CURRENTVERSION="$(sed -n "s|.*\OC_VersionString = '*\(.*[^ ]\) *';.*|\1|p" /data/config/www/nextcloud/version.php)"
@@ -21,15 +25,15 @@ function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4
if ! bashio::config.true "disable_updates"; then
bashio::log.green "Auto_updater set, checking for updates"
# Install new version
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
sudo -u \#"$PUID" -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u \#"$PUID" -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
# Install additional versions
while [[ $(occ update:check 2>&1) == *"update available"* ]]; do
bashio::log.yellow "-----------------------------------------------------------------------"
bashio::log.yellow " new version available, updating. Please do not turn off your addon! "
bashio::log.yellow "-----------------------------------------------------------------------"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
sudo -u \#"$PUID" -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u \#"$PUID" -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
done
# Reset permissions
/./etc/cont-init.d/01-folders.sh