fix: $ENV_DIR -> $ETC_DIR and add updated message

This commit is contained in:
2025-06-18 20:49:16 +02:00
parent 1984b4fe70
commit 98aa864306
2 changed files with 8 additions and 3 deletions

View File

@@ -67,8 +67,13 @@ create_env_variable() {
local value="$2" local value="$2"
if [[ -z "$value" ]]; then if [[ -z "$value" ]]; then
datetime_print "$key not set (empty input)." if grep -q "^$key=*" "$ENV_FILE" 2>/dev/null; then
return datetime_print "$key not updated."
return
else
datetime_print "$key not set (empty input)."
return
fi
fi fi
if grep -q "^$key=" "$ENV_FILE" 2>/dev/null; then if grep -q "^$key=" "$ENV_FILE" 2>/dev/null; then

View File

@@ -3,7 +3,7 @@
FILENAME="serverconfig" FILENAME="serverconfig"
ETC_DIR="/etc/$FILENAME" ETC_DIR="/etc/$FILENAME"
ENV_FILE="$ENV_DIR/.env" ENV_FILE="$ETC_DIR/.env"
LOG="/var/log/$FILENAME.log" LOG="/var/log/$FILENAME.log"
DATETIME_FORMAT="%d-%m-%Y %H:%M:%S" DATETIME_FORMAT="%d-%m-%Y %H:%M:%S"