This repository has been archived on 2024-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
its-zones/server/knot-gpgv-import

21 lines
344 B
Text
Raw Normal View History

2021-04-13 07:58:31 +02:00
#!/bin/sh
set -eu
file="$1"
case "$file" in
*.zone.sig) ;;
# Ignore everything else
*) exit 0 ;;
esac
zone=${file%*.sig}
2021-04-13 07:58:31 +02:00
[ -f "$file" ] || exit 1
[ -f "$zone" ] || exit 2
gpgv --keyring $HOME/trustedkeys.kbx "$file" "$zone" || exit 3
cp -t /var/lib/knot "$zone" || exit 4
sudo -u knot knotc zone-reload "$(basename "${zone%*.zone*}")"