1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/network/templates/named.unused/named
2022-07-16 04:36:22 -05:00

41 lines
1.3 KiB
Bash

#!/bin/sh -e
# This file is called when the domain name is changed, to change any
# named configuration files affected.
#
# The first argument is the new domain name,
# Copyright 2008, One Laptop per Child
# Authors: John Watlington, Martin Langhoff
# License: GPLv2
# This is the name of the service (for stopping and restarting)
SERVICE_NAME={{ dns_service }}
# This is a list of files related to this service which will have
# the domain name globally replaced inside them
CONFIG_LIST="/etc/named-iiab.conf /var/named-iiab/school.internal.zone.in-addr.db /var/named-iiab/school.internal.zone.in-addr.db /var/named-iiab/school.internal.zone.16.in-addr.db /var/named-iiab/school.internal.zone.32.in-addr.db /var/named-iiab/school.internal.zone.48.in-addr.db"
# This is the suffix which original versions of modified files will have
BACKUP_SUFFIX=old
new_name=$1
for config in $CONFIG_LIST;
do
if [ -e $config.in ]; then
if [ -e $config ]; then
mv $config $config.$BACKUP_SUFFIX
fi
sed -e s/@@BASEDNSNAME@@/$new_name/ $config.in > $config ;
else
echo WARNING: Skipped $config - template file is missing!
fi
done
# Since for the community edition, we don't really expect all modules to be present
# Just exit, and expect the user to do a restart
exit 0