-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow-signed
More file actions
executable file
·39 lines (28 loc) · 732 Bytes
/
show-signed
File metadata and controls
executable file
·39 lines (28 loc) · 732 Bytes
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
#!/bin/bash
# Copyright 2014-2015 Richard Russon (FlatCap)
# Licensed under the GPLv3
PATH="/var/named/bin:/usr/bin:/usr/sbin"
source log.sh
export TZ="UTC"
set -o errexit # set -e
set -o nounset # set -u
renice --priority 19 --pid $$ > /dev/null
ionice --class 3 --pid $$ > /dev/null
shopt -s nullglob
function finish()
{
local RETVAL=$?
[ $RETVAL = 0 ] || log_error "${0##*/} failed: $RETVAL"
}
trap finish EXIT
cd /var/named
for i in *.db.signed; do
SERIAL=$(grep -o "\<[[:digit:]]\{10\}\>[[:space:]]*;[[:space:]]*serial" "$i")
SERIAL=${SERIAL:0:10}
ZONE=${i%.db.signed}
RECORDS=$(grep -cwh "RRSIG" "$i")
log_info "Signed zone: $ZONE"
echo -e "\tSerial: $SERIAL"
echo -e "\tRecords: $RECORDS"
echo
done