mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-13 19:11:35 +02:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
e5adbd266f
commit
f728166b14
@@ -3,11 +3,11 @@
|
||||
set -e
|
||||
|
||||
if bashio::config.has_value "PUID" && bashio::config.has_value "PGID"; then
|
||||
PUID="$(bashio::config "PUID")"
|
||||
PGID="$(bashio::config "PGID")"
|
||||
bashio::log.green "Setting user to $PUID:$PGID"
|
||||
id -u abc &>/dev/null || usermod -o -u "$PUID" abc || true
|
||||
id -g abc &>/dev/null || groupmod -o -g "$PGID" abc || true
|
||||
PUID="$(bashio::config "PUID")"
|
||||
PGID="$(bashio::config "PGID")"
|
||||
bashio::log.green "Setting user to $PUID:$PGID"
|
||||
id -u abc &>/dev/null || usermod -o -u "$PUID" abc || true
|
||||
id -g abc &>/dev/null || groupmod -o -g "$PGID" abc || true
|
||||
fi
|
||||
|
||||
echo "Updating permissions..."
|
||||
@@ -18,44 +18,44 @@ chown -R "$PUID:$PGID" "/data/config"
|
||||
|
||||
# Check current version
|
||||
if [ -f /data/config/www/nextcloud/config/config.php ]; then
|
||||
datadirectory="$(sed -n "s|.*datadirectory.*' => '*\(.*[^ ]\) *',.*|\1|p" /data/config/www/nextcloud/config/config.php)"
|
||||
echo "... data directory detected : $datadirectory"
|
||||
datadirectory="$(sed -n "s|.*datadirectory.*' => '*\(.*[^ ]\) *',.*|\1|p" /data/config/www/nextcloud/config/config.php)"
|
||||
echo "... data directory detected : $datadirectory"
|
||||
else
|
||||
datadirectory=/config/data
|
||||
echo "Nextcloud is not installed yet, the default data directory is : $datadirectory. You can change it during nextcloud installation."
|
||||
mkdir -p /config/data
|
||||
chmod 777 /config/data
|
||||
mkdir -p /share/nextcloud
|
||||
chmod 777 /share/nextcloud
|
||||
datadirectory=/config/data
|
||||
echo "Nextcloud is not installed yet, the default data directory is : $datadirectory. You can change it during nextcloud installation."
|
||||
mkdir -p /config/data
|
||||
chmod 777 /config/data
|
||||
mkdir -p /share/nextcloud
|
||||
chmod 777 /share/nextcloud
|
||||
fi
|
||||
|
||||
# Is the directory valid
|
||||
if [[ "$datadirectory" == *"/mnt/"* ]] && [ ! -f "$datadirectory"/index.html ]; then
|
||||
bashio::log.fatal "Data directory does not seem to be valid. Is your drive connected? Stopping to avoid corrupting the data directory."
|
||||
bashio::addon.stop
|
||||
bashio::log.fatal "Data directory does not seem to be valid. Is your drive connected? Stopping to avoid corrupting the data directory."
|
||||
bashio::addon.stop
|
||||
fi
|
||||
|
||||
# Remove nginx conf if existing
|
||||
if [ -f /data/config/nginx/site-confs/default.conf ]; then
|
||||
rm /data/config/nginx/site-confs/default.conf
|
||||
# Avoid cannot enable app
|
||||
sed -i "s|front_controller_active true|front_controller_active false|g" /defaults/nginx/site-confs/default.conf.sample
|
||||
rm /data/config/nginx/site-confs/default.conf
|
||||
# Avoid cannot enable app
|
||||
sed -i "s|front_controller_active true|front_controller_active false|g" /defaults/nginx/site-confs/default.conf.sample
|
||||
fi
|
||||
|
||||
# Set permissions
|
||||
mkdir -p "$datadirectory"
|
||||
if bashio::config.true "skip_permissions_check"; then
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
bashio::log.yellow "Permissions check skipped : \"skip_permissions_check\" is true"
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
bashio::log.yellow "Permissions check skipped : \"skip_permissions_check\" is true"
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
elif [[ "$PUID" = "0" ]] && [[ "$PGID" = "0" ]]; then
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
bashio::log.yellow "Permissions check skipped : \"PUID and PGID are 0\" is true"
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
bashio::log.yellow "Permissions check skipped : \"PUID and PGID are 0\" is true"
|
||||
bashio::log.yellow "--------------------------------------------"
|
||||
else
|
||||
bashio::log.yellow "... setting permissions, this might take a long time. If it takes too long at each boot, you could instead activate skip_permissions_check in the addon options"
|
||||
chmod 755 -R "$datadirectory" || true
|
||||
chown -R "$PUID:$PGID" "$datadirectory" || true
|
||||
bashio::log.yellow "... setting permissions, this might take a long time. If it takes too long at each boot, you could instead activate skip_permissions_check in the addon options"
|
||||
chmod 755 -R "$datadirectory" || true
|
||||
chown -R "$PUID:$PGID" "$datadirectory" || true
|
||||
fi
|
||||
|
||||
mkdir -p /scripts
|
||||
|
||||
Reference in New Issue
Block a user