PandABlocks / PandABlocks-rootfs

Root filesystem build with tools for building zpg packages
Apache License 2.0
3 stars 5 forks source link

Allow leading spaces in config.txt #9

Closed thomascobb closed 3 years ago

thomascobb commented 3 years ago

This confused some PandA users...

Araneidae commented 3 years ago

The following patch should probably do the job:

diff --git a/rootfs/network/parse-config b/rootfs/network/parse-config
index 8096c7c..4e78b78 100755
--- a/rootfs/network/parse-config
+++ b/rootfs/network/parse-config
@@ -34,7 +34,7 @@ echo "$CONFIG_FILE" >/tmp/config_file
 parse_config()
 {
     local config="$(
-        sed -n "/^$1[ \t]*=[ \t]*/{s///;s/[ \t]*$//;p}" <"$CONFIG_FILE")"
+        sed -n "/^[ \t]*$1[ \t]*=[ \t]*/{s///;s/[ \t]*$//;p}" <"$CONFIG_FILE")"
     printf %s "$config"
     [ -n "$config" ]
 }