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"