mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-15 22:51:37 -07:00
Shell Check fixes
This commit is contained in:
@@ -52,11 +52,11 @@ EOF
|
||||
>&2 printf "%s" "${RESET}"
|
||||
|
||||
# Set ownership to netalertx user for all read-write paths
|
||||
chown -R netalertx ${READ_WRITE_PATHS} 2>/dev/null || true
|
||||
chown -R netalertx "${READ_WRITE_PATHS}" 2>/dev/null || true
|
||||
|
||||
# Set directory and file permissions for all read-write paths
|
||||
find ${READ_WRITE_PATHS} -type d -exec chmod u+rwx {} \;
|
||||
find ${READ_WRITE_PATHS} -type f -exec chmod u+rw {} \;
|
||||
find "${READ_WRITE_PATHS}" -type d -exec chmod u+rwx {} \;
|
||||
find "${READ_WRITE_PATHS}" -type f -exec chmod u+rw {} \;
|
||||
echo Permissions fixed for read-write paths. Please restart the container as user 20211.
|
||||
sleep infinity & wait $!
|
||||
fi
|
||||
|
||||
@@ -16,11 +16,11 @@ LEGACY_DB=/app/db
|
||||
MARKER_NAME=.migration
|
||||
|
||||
is_mounted() {
|
||||
local path="$1"
|
||||
if [ ! -d "${path}" ]; then
|
||||
my_path="$1"
|
||||
if [ ! -d "${my_path}" ]; then
|
||||
return 1
|
||||
fi
|
||||
mountpoint -q "${path}" 2>/dev/null
|
||||
mountpoint -q "${my_path}" 2>/dev/null
|
||||
}
|
||||
|
||||
warn_unmount_legacy() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# first-run-check.sh - Checks and initializes configuration files on first run
|
||||
|
||||
# Check for app.conf and deploy if required
|
||||
if [ ! -f ${NETALERTX_CONFIG}/app.conf ]; then
|
||||
if [ ! -f "${NETALERTX_CONFIG}/app.conf" ]; then
|
||||
mkdir -p "${NETALERTX_CONFIG}" || {
|
||||
>&2 echo "ERROR: Failed to create config directory ${NETALERTX_CONFIG}"
|
||||
exit 1
|
||||
|
||||
@@ -441,7 +441,9 @@ CREATE TRIGGER "trg_delete_devices"
|
||||
END;
|
||||
end-of-database-schema
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
database_creation_status=$?
|
||||
|
||||
if [ $database_creation_status -ne 0 ]; then
|
||||
RED=$(printf '\033[1;31m')
|
||||
RESET=$(printf '\033[0m')
|
||||
>&2 printf "%s" "${RED}"
|
||||
|
||||
Reference in New Issue
Block a user