blob: 6cf7a42ac3b3a8ddc9fe4331c14c6dc14275ce79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#!/usr/bin/env bash
# This package is needed on Debian derived ditributions: libglib2.0-bin
cb() {
case "$1" in
zone_ksk_submission)
echo "Ready KSK for zone=${2} keytag=${3} keyid=${4}"
;;
keys_updated)
echo "Keys updated for zone=${2}"
;;
zone_updated)
echo "Updated zone=${2} to serial=${3}"
;;
zone_dnssec_invalid)
echo "Invalid DNSSEC for zone=${2} remaining=${3} seconds"
;;
started)
echo "Server started"
;;
stopped)
echo "Server stopped"
;;
esac
}
awk="awk"
# If awk is mawk, turn off input buffering.
if ($awk -Wv 2>&1 | grep -q "mawk") && \
($awk -W interactive > /dev/null 2>&1); then
awk=${awk}" -W interactive"
fi
gdbus monitor --system --dest cz.nic.knotd --object-path /cz/nic/knotd \
| $awk '/^\/cz\/nic\/knotd/ {
gsub("cz.nic.knotd.events.", "", $2);
tmp="";
for(i=3;i<=NF;++i) {
if( $i ~ /[\),]$/ ) tmp=tmp$i;
}
gsub(/(^\()|(\)$)|\47/, "", tmp);
items=split(tmp, args, ",");
printf "%s ", $2;
for(i=1;i<=items;i++) printf "%s ", args[i];
print "";
fflush(stdout); }' \
| while read line; do \
cb ${line[@]}; \
done
|