This commit is contained in:
Hans Karlinius
2024-12-03 03:05:17 +01:00
parent 7e25ea88a9
commit 443a2366db
3 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: VirtualHere Client name: VirtualHere Client
version: "0.1.332" version: "0.1.333"
slug: vhclient slug: vhclient
description: VirtualHere Client description: VirtualHere Client
arch: arch:
+1 -1
View File
@@ -3,4 +3,4 @@
file="/config/vhclient.ini" file="/config/vhclient.ini"
touch $file 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
+14 -4
View File
@@ -1,13 +1,23 @@
#!/usr/bin/awk -f #!/usr/bin/awk -f
BEGIN { BEGIN {
found_section = false; found_section = 0;
found_key = 0;
} }
0$ ~ "^\[" $section { $0 ~ "^\\[" section "\\]" {
found_section = true; found_section = 1;
}
$0 ~ "^\\[" key "\\]" {
if (found_section)
found_key = 1;
}
/.*/ {
print $0;
} }
END { END {
print "Found section: $found_section"; print "Found section: " section " " found_section " and " key " " found_key;
} }