From c96463bda20ca261286c7b4e7dc2a5dbc1103723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Wed, 22 Mar 2023 22:56:00 +0100 Subject: [PATCH] Fix getting 'privacylevel' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ccb5eac7..24fe9e54 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2612,7 +2612,8 @@ main() { # Get the privacy level if it exists (default is 0) if [[ -f "${FTL_CONFIG_FILE}" ]]; then - PRIVACY_LEVEL=$(sed -ne 's/PRIVACYLEVEL=\(.*\)/\1/p' "${FTL_CONFIG_FILE}") + # get the value from $FTL_CONFIG_FILE (and ignoring all commented lines) + PRIVACY_LEVEL=$(sed -e '/^[[:blank:]]*#/d' "${FTL_CONFIG_FILE}" | grep "PRIVACYLEVEL" | awk -F "=" 'NR==1{printf$2}') # If no setting was found, default to 0 PRIVACY_LEVEL="${PRIVACY_LEVEL:-0}"