This commit is contained in:
Hans Karlinius
2024-12-03 03:58:06 +01:00
parent de2c32727b
commit f3e3b0325a
3 changed files with 10 additions and 5 deletions

View File

@@ -3,4 +3,10 @@
file="/config/vhclient.ini"
touch $file
awk -f /usr/bin/vh_editini.awk -v section=$1 -v key=$2 -v value=$3 $file
if [ -z "${3:-}" ]; then
v = ''
else
v = $3
fi
awk -f /usr/bin/vh_editini.awk -v section=$1 -v key=$2 -v value=$v $file

View File

@@ -10,7 +10,7 @@ $0 ~ "^" key "=" {
if (found_section) {
found_key = 1;
edited_row = 1;
if (value) {
if (value || value == 0) {
print key "=" value;
}
}
@@ -19,8 +19,7 @@ $0 ~ "^" key "=" {
$0 ~ "^\\[" {
if (found_section && !found_key) {
found_key = 1;
edited_row = 1;
if (value) {
if (value || value == 0) {
print key "=" value;
}
}