X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=bin%2Fkhatus_parse_bluetoothctl_show;h=0d56853a219de40c21a6b96e3ba5bb1b8f6a311f;hb=f4085a843109199a05003c7a0949a737a4d74f21;hp=7de42cf41bfcbca2b0ab36e0546e60d8d23a552e;hpb=cdbd608379ebcae2039eb59cbc49a51c724c20b7;p=khatus.git diff --git a/bin/khatus_parse_bluetoothctl_show b/bin/khatus_parse_bluetoothctl_show index 7de42cf..0d56853 100755 --- a/bin/khatus_parse_bluetoothctl_show +++ b/bin/khatus_parse_bluetoothctl_show @@ -1,5 +1,10 @@ #! /usr/bin/awk -f +BEGIN { + OFS = msg_fs ? msg_fs : "|" + Kfs = key_fs ? key_fs : ":" +} + /^Controller / { controller = $2 controllers[++ctrl_count] = controller @@ -8,7 +13,7 @@ /^\t[A-Z][A-Za-z]+:/ { key = $1 sub(":$", "", key) - sub("^" $1, "") + sub("^\t" $1 " *", "") val = $0 data[controller, key] = val } @@ -28,7 +33,7 @@ END { } else { show = "n/a" } - print(show) + print("power_status", show) } function print_error(msg) {