diff --git a/papermerge/rootfs/etc/cont-init.d/99-configuration.sh b/papermerge/rootfs/etc/cont-init.d/99-configuration.sh index dad6961f6..42a5180bc 100644 --- a/papermerge/rootfs/etc/cont-init.d/99-configuration.sh +++ b/papermerge/rootfs/etc/cont-init.d/99-configuration.sh @@ -31,14 +31,14 @@ if [ ! -d /config ]; then fi chown -R abc:abc /config -if [ ! -d $MEDIADIR ]; then +if [ ! -d "$MEDIADIR" ]; then echo "Creating $MEDIADIR" - mkdir -p $MEDIADIR + mkdir -p "$MEDIADIR" fi -chown -R abc:abc $MEDIADIR +chown -R abc:abc "$MEDIADIR" -if [ ! -d $IMPORTDIR ]; then +if [ ! -d "$IMPORTDIR" ]; then echo "Creating $IMPORTDIR" - mkdir -p $IMPORTDIR + mkdir -p "$IMPORTDIR" fi -chown -R abc:abc $IMPORTDIR +chown -R abc:abc "$IMPORTDIR" diff --git a/photoprism/rootfs/etc/cont-init.d/99-run.sh b/photoprism/rootfs/etc/cont-init.d/99-run.sh index 137795a60..34af0b9f3 100644 --- a/photoprism/rootfs/etc/cont-init.d/99-run.sh +++ b/photoprism/rootfs/etc/cont-init.d/99-run.sh @@ -42,7 +42,7 @@ mariadb_addon) bashio::log.warning "Please ensure this is included in your backups" bashio::log.warning "Uninstalling the MariaDB addon will remove any data" - mysql --host=$(bashio::services 'mysql' 'host') --port=$(bashio::services 'mysql' 'port') --user=$PHOTOPRISM_DATABASE_USER --password=$PHOTOPRISM_DATABASE_PASSWORD -e"CREATE DATABASE IF NOT EXISTS $PHOTOPRISM_DATABASE_NAME; CHARACTER SET = utf8mb4; COLLATE = utf8mb4_unicode_ci;" || true + mysql --host="$(bashio::services 'mysql' 'host')" --port="$(bashio::services 'mysql' 'port')" --user="$PHOTOPRISM_DATABASE_USER" --password="$PHOTOPRISM_DATABASE_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS $PHOTOPRISM_DATABASE_NAME; CHARACTER SET = utf8mb4; COLLATE = utf8mb4_unicode_ci;" || true ;; esac @@ -51,23 +51,28 @@ esac ############## # Configure app -export PHOTOPRISM_UPLOAD_NSFW=$(bashio::config 'UPLOAD_NSFW') -export PHOTOPRISM_STORAGE_PATH=$(bashio::config 'STORAGE_PATH') -export PHOTOPRISM_ORIGINALS_PATH=$(bashio::config 'ORIGINALS_PATH') -export PHOTOPRISM_IMPORT_PATH=$(bashio::config 'IMPORT_PATH') -export PHOTOPRISM_BACKUP_PATH=$(bashio::config 'BACKUP_PATH') +PHOTOPRISM_UPLOAD_NSFW=$(bashio::config 'UPLOAD_NSFW') +PHOTOPRISM_STORAGE_PATH=$(bashio::config 'STORAGE_PATH') +PHOTOPRISM_ORIGINALS_PATH=$(bashio::config 'ORIGINALS_PATH') +PHOTOPRISM_IMPORT_PATH=$(bashio::config 'IMPORT_PATH') +PHOTOPRISM_BACKUP_PATH=$(bashio::config 'BACKUP_PATH') +export PHOTOPRISM_UPLOAD_NSFW +export PHOTOPRISM_STORAGE_PATH +export PHOTOPRISM_ORIGINALS_PATH +export PHOTOPRISM_IMPORT_PATH +export PHOTOPRISM_BACKUP_PATH # Test configs for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do # Check if path exists - if bashio::fs.directory_exists $variabletest; then + if bashio::fs.directory_exists "$variabletest"; then true else bashio::log.info "Path $variabletest doesn't exist. Creating it now..." - mkdir -p $variabletest || bashio::log.fatal "Can't create $variabletest path" + mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path" fi # Check if path writable - touch $variabletest/aze && rm $variabletest/aze || bashio::log.fatal "$variable path is not writable" + touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable" done # Start messages diff --git a/photoprism/rootfs/run.sh b/photoprism/rootfs/run.sh index 8ac56bc61..37458d250 100644 --- a/photoprism/rootfs/run.sh +++ b/photoprism/rootfs/run.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bashio # shellcheck shell=bash +# shellcheck disable=SC2155,SC2015 ########### # SCRIPTS # @@ -35,14 +36,14 @@ fi # Test configs for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do # Check if path exists - if bashio::fs.directory_exists $variabletest; then + if bashio::fs.directory_exists "$variabletest"; then true else bashio::log.info "Path $variabletest doesn't exist. Creating it now..." - mkdir -p $variabletest || bashio::log.fatal "Can't create $variabletest path" + mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path" fi # Check if path writable - touch $variabletest/aze && rm $variabletest/aze || bashio::log.fatal "$variable path is not writable" + touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable" done # Start messages @@ -50,4 +51,4 @@ bashio::log.info "Please wait 1 or 2 minutes to allow the server to load" bashio::log.info 'Default username : admin, default password: "please_change_password"' cd / -./entrypoint.sh photoprism start '"'$CUSTOMOPTIONS'"' +./entrypoint.sh photoprism start '"'"$CUSTOMOPTIONS"'"' diff --git a/piwigo/rootfs/etc/cont-init.d/41-folders.sh b/piwigo/rootfs/etc/cont-init.d/41-folders.sh index a61f2fce0..2b7c98d91 100644 --- a/piwigo/rootfs/etc/cont-init.d/41-folders.sh +++ b/piwigo/rootfs/etc/cont-init.d/41-folders.sh @@ -40,4 +40,5 @@ fi ################## # CORRECT CONFIG # ################## +# shellcheck disable=SC2015 sed -i 's|E_ALL|""|g' /share/piwigo/config/config.inc.php && echo "config corrected for php error" || true