mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-06 05:58:47 +02:00
lint
This commit is contained in:
@@ -31,14 +31,14 @@ if [ ! -d /config ]; then
|
|||||||
fi
|
fi
|
||||||
chown -R abc:abc /config
|
chown -R abc:abc /config
|
||||||
|
|
||||||
if [ ! -d $MEDIADIR ]; then
|
if [ ! -d "$MEDIADIR" ]; then
|
||||||
echo "Creating $MEDIADIR"
|
echo "Creating $MEDIADIR"
|
||||||
mkdir -p $MEDIADIR
|
mkdir -p "$MEDIADIR"
|
||||||
fi
|
fi
|
||||||
chown -R abc:abc $MEDIADIR
|
chown -R abc:abc "$MEDIADIR"
|
||||||
|
|
||||||
if [ ! -d $IMPORTDIR ]; then
|
if [ ! -d "$IMPORTDIR" ]; then
|
||||||
echo "Creating $IMPORTDIR"
|
echo "Creating $IMPORTDIR"
|
||||||
mkdir -p $IMPORTDIR
|
mkdir -p "$IMPORTDIR"
|
||||||
fi
|
fi
|
||||||
chown -R abc:abc $IMPORTDIR
|
chown -R abc:abc "$IMPORTDIR"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ mariadb_addon)
|
|||||||
bashio::log.warning "Please ensure this is included in your backups"
|
bashio::log.warning "Please ensure this is included in your backups"
|
||||||
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
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
|
esac
|
||||||
|
|
||||||
@@ -51,23 +51,28 @@ esac
|
|||||||
##############
|
##############
|
||||||
|
|
||||||
# Configure app
|
# Configure app
|
||||||
export PHOTOPRISM_UPLOAD_NSFW=$(bashio::config 'UPLOAD_NSFW')
|
PHOTOPRISM_UPLOAD_NSFW=$(bashio::config 'UPLOAD_NSFW')
|
||||||
export PHOTOPRISM_STORAGE_PATH=$(bashio::config 'STORAGE_PATH')
|
PHOTOPRISM_STORAGE_PATH=$(bashio::config 'STORAGE_PATH')
|
||||||
export PHOTOPRISM_ORIGINALS_PATH=$(bashio::config 'ORIGINALS_PATH')
|
PHOTOPRISM_ORIGINALS_PATH=$(bashio::config 'ORIGINALS_PATH')
|
||||||
export PHOTOPRISM_IMPORT_PATH=$(bashio::config 'IMPORT_PATH')
|
PHOTOPRISM_IMPORT_PATH=$(bashio::config 'IMPORT_PATH')
|
||||||
export PHOTOPRISM_BACKUP_PATH=$(bashio::config 'BACKUP_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
|
# Test configs
|
||||||
for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do
|
for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do
|
||||||
# Check if path exists
|
# Check if path exists
|
||||||
if bashio::fs.directory_exists $variabletest; then
|
if bashio::fs.directory_exists "$variabletest"; then
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
bashio::log.info "Path $variabletest doesn't exist. Creating it now..."
|
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
|
fi
|
||||||
# Check if path writable
|
# 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
|
done
|
||||||
|
|
||||||
# Start messages
|
# Start messages
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bashio
|
#!/usr/bin/env bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
# shellcheck disable=SC2155,SC2015
|
||||||
|
|
||||||
###########
|
###########
|
||||||
# SCRIPTS #
|
# SCRIPTS #
|
||||||
@@ -35,14 +36,14 @@ fi
|
|||||||
# Test configs
|
# Test configs
|
||||||
for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do
|
for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do
|
||||||
# Check if path exists
|
# Check if path exists
|
||||||
if bashio::fs.directory_exists $variabletest; then
|
if bashio::fs.directory_exists "$variabletest"; then
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
bashio::log.info "Path $variabletest doesn't exist. Creating it now..."
|
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
|
fi
|
||||||
# Check if path writable
|
# 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
|
done
|
||||||
|
|
||||||
# Start messages
|
# 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"'
|
bashio::log.info 'Default username : admin, default password: "please_change_password"'
|
||||||
|
|
||||||
cd /
|
cd /
|
||||||
./entrypoint.sh photoprism start '"'$CUSTOMOPTIONS'"'
|
./entrypoint.sh photoprism start '"'"$CUSTOMOPTIONS"'"'
|
||||||
|
|||||||
@@ -40,4 +40,5 @@ fi
|
|||||||
##################
|
##################
|
||||||
# CORRECT CONFIG #
|
# CORRECT CONFIG #
|
||||||
##################
|
##################
|
||||||
|
# shellcheck disable=SC2015
|
||||||
sed -i 's|E_ALL|""|g' /share/piwigo/config/config.inc.php && echo "config corrected for php error" || true
|
sed -i 's|E_ALL|""|g' /share/piwigo/config/config.inc.php && echo "config corrected for php error" || true
|
||||||
|
|||||||
Reference in New Issue
Block a user