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
2021-04-13 08:06:05 +02:00

20 lines
417 B
Bash

#!/bin/sh
set -eu
file="$1"
case "$file" in
# We don't control the order of the zone/sig upload so just try on both
*.zone) ;;
*.zone.sig) ;;
# Ignore everything else
*) exit 0 ;;
esac
[ -f "$file" ] || exit 1
[ -f "$file".sig ] || exit 2
gpgv --keyring $HOME/trustedkeys.kbx "$file".sig "$file" || exit 3
cp -t /var/lib/knot "$file" || exit 4
sudo -u knot knotc zone-reload "$(basename "${file%*.zone*}")"