From 98aa864306bc31947ce8a1da868dfd9bd2dfe94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Wed, 18 Jun 2025 20:49:16 +0200 Subject: [PATCH] fix: $ENV_DIR -> $ETC_DIR and add updated message --- install.sh | 9 +++++++-- scripts/common.sh | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 2369c03..19cd2a0 100644 --- a/install.sh +++ b/install.sh @@ -67,8 +67,13 @@ create_env_variable() { local value="$2" if [[ -z "$value" ]]; then - datetime_print "$key not set (empty input)." - return + if grep -q "^$key=*" "$ENV_FILE" 2>/dev/null; then + datetime_print "$key not updated." + return + else + datetime_print "$key not set (empty input)." + return + fi fi if grep -q "^$key=" "$ENV_FILE" 2>/dev/null; then diff --git a/scripts/common.sh b/scripts/common.sh index 6ec32b4..639cbda 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -3,7 +3,7 @@ FILENAME="serverconfig" ETC_DIR="/etc/$FILENAME" -ENV_FILE="$ENV_DIR/.env" +ENV_FILE="$ETC_DIR/.env" LOG="/var/log/$FILENAME.log" DATETIME_FORMAT="%d-%m-%Y %H:%M:%S"