summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorDavid VaĊĦek <david.vasek@nic.cz>2022-01-31 14:42:20 +0100
committerDaniel Salzman <daniel.salzman@nic.cz>2022-02-01 14:09:15 +0100
commit766538376c4d865b6e5e253fe62a706c9dad9f0c (patch)
tree891dd2b07aeb1ba0aeada7e3abfea424179590db /samples
parentsamples: improve the portability of dbus_client.sh (diff)
downloadknot-766538376c4d865b6e5e253fe62a706c9dad9f0c.tar.xz
knot-766538376c4d865b6e5e253fe62a706c9dad9f0c.zip
samples: dbus_client.sh -- allow event specific processing
Diffstat (limited to 'samples')
-rwxr-xr-xsamples/dbus_client.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/samples/dbus_client.sh b/samples/dbus_client.sh
index 5a08a3038..adf654724 100755
--- a/samples/dbus_client.sh
+++ b/samples/dbus_client.sh
@@ -1,9 +1,20 @@
#!/usr/bin/env bash
cb() {
- p1=$1;
- shift;
- echo "$p1 [$@]"
+ case "$1" in
+ zone_ksk_submission)
+ echo "Ready KSK for zone=${2} keytag=${3} keyid=${4}"
+ ;;
+ zone_updated)
+ echo "Updated zone=${2} to serial=${3}"
+ ;;
+ started)
+ echo "Server started"
+ ;;
+ stopped)
+ echo "Server stopped"
+ ;;
+ esac
}
gdbus monitor --system --dest cz.nic.knotd --object-path /cz/nic/knotd \
@@ -13,7 +24,7 @@ gdbus monitor --system --dest cz.nic.knotd --object-path /cz/nic/knotd \
for(i=3;i<=NF;++i) {
if( $i ~ /[\),]$/ ) tmp=tmp$i;
}
- gsub(/(^\()|(\)$)/, "", tmp);
+ gsub(/(^\()|(\)$)|\47/, "", tmp);
items=split(tmp, args, ",");
printf "%s ", $2;
for(i=1;i<=items;i++) printf "%s ", args[i];