ansible-roles/bind/files/bind-reload-zone.sh
William Hirigoyen 41897f4c62
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2670|2|2668|2|:-1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/442//ansiblelint">Evolix » ansible-roles » unstable #442</a>
gitea/ansible-roles/pipeline/head This commit looks good
bind: improve reload script
2023-12-29 12:12:39 +01:00

38 lines
620 B
Bash
Executable file

#!/bin/bash
#
# Script utilitaire pour tester et recharger facilement une zone dans Bind
#
usage() {
echo "Usage: bind-reload-zone <DOMAIN>"
echo " bind-reload-zone -h|--help"
}
if [ $# -ne 1 ] ; then
usage
exit 1
fi
while :; do
case $1 in
-h|--help)
usage
exit 0
;;
*)
zone=$1
break
;;
esac
shift
done
if ! [ -f "/etc/bind/db.${zone}" ]; then
>&2 echo "Error: zone for ${zone} not found."
usage
exit 1
fi
named-checkzone "${zone}" /etc/bind/db."${zone}" && rndc reload "${zone}"