From 51cfddec6be5dca62b92d4a81ea4eab7d6af43b8 Mon Sep 17 00:00:00 2001 From: Hans Karlinius Date: Mon, 2 Dec 2024 17:31:57 +0100 Subject: [PATCH] test --- vhclient/config.yaml | 2 +- vhclient/rootfs/usr/bin/vh_editini | 36 ++++++++++++++++++------------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/vhclient/config.yaml b/vhclient/config.yaml index 647af6c..238f98b 100644 --- a/vhclient/config.yaml +++ b/vhclient/config.yaml @@ -1,5 +1,5 @@ name: VirtualHere Client -version: "0.1.330" +version: "0.1.331" slug: vhclient description: VirtualHere Client arch: diff --git a/vhclient/rootfs/usr/bin/vh_editini b/vhclient/rootfs/usr/bin/vh_editini index b1229f0..dedd140 100755 --- a/vhclient/rootfs/usr/bin/vh_editini +++ b/vhclient/rootfs/usr/bin/vh_editini @@ -1,18 +1,26 @@ -#!/usr/bin/awk -f +#!/command/with-contenv bashio -BEGIN { - section = $2; - key = $3; - value = $4; - found_section = false; +file="/config/vhclient.ini" +touch $file + +editini() { + awk -f + BEGIN { + section = $1; + key = $2; + value = $3; + found_section = false; + } + + /^\[$section\]/ { + found_section = true; + } + + END { + print "Found section: $found_section"; + } + $file } -/^\[$section\]/ { - found_section = true; -} +editini $1 $2 $3 -END { - print "Found section: $found_section"; -} - -/config/vhclient.ini