diff --git a/vhclient/config.yaml b/vhclient/config.yaml index 9493b6d..047b945 100644 --- a/vhclient/config.yaml +++ b/vhclient/config.yaml @@ -1,5 +1,5 @@ name: VirtualHere Client -version: "0.1.332" +version: "0.1.333" slug: vhclient description: VirtualHere Client arch: diff --git a/vhclient/rootfs/usr/bin/vh_editini b/vhclient/rootfs/usr/bin/vh_editini index 6c39511..0ca863c 100755 --- a/vhclient/rootfs/usr/bin/vh_editini +++ b/vhclient/rootfs/usr/bin/vh_editini @@ -3,4 +3,4 @@ file="/config/vhclient.ini" touch $file -awk -f vh_editini.awk -v section=$1 -v key=$2 -v value=$3 $file +awk -f /usr/bin/vh_editini.awk -v section=$1 -v key=$2 -v value=$3 $file diff --git a/vhclient/rootfs/usr/bin/vh_editini.awk b/vhclient/rootfs/usr/bin/vh_editini.awk index ae385d6..a28ab52 100755 --- a/vhclient/rootfs/usr/bin/vh_editini.awk +++ b/vhclient/rootfs/usr/bin/vh_editini.awk @@ -1,13 +1,23 @@ #!/usr/bin/awk -f BEGIN { - found_section = false; + found_section = 0; + found_key = 0; } -0$ ~ "^\[" $section { - found_section = true; +$0 ~ "^\\[" section "\\]" { + found_section = 1; +} + +$0 ~ "^\\[" key "\\]" { + if (found_section) + found_key = 1; +} + +/.*/ { + print $0; } END { - print "Found section: $found_section"; + print "Found section: " section " " found_section " and " key " " found_key; }