From 8b34f23264aed085c3aa0c60060f60b404773aec Mon Sep 17 00:00:00 2001 From: probonopd Date: Sat, 16 Nov 2024 11:32:15 +0000 Subject: [PATCH] Skip empty lines and comments --- hwconfig/customize.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hwconfig/customize.sh b/hwconfig/customize.sh index 7426d96..687b568 100755 --- a/hwconfig/customize.sh +++ b/hwconfig/customize.sh @@ -11,6 +11,10 @@ for file in *.override; do # Change the values in the ini file, leaving the rest of the file unchanged while IFS='=' read -r key value; do + # Skip empty lines and comments + if [ -z "$key" ] || [ "${key#\#}" != "$key" ]; then + continue + fi value=$(echo "$value" | tr -d '\r') if [ -n "$value" ]; then sed -i "s/^$key=.*/$key=$value/" "$name_of_ini_file"