bind/generate-rndc-key.sh
Adam Tkac 0f7d49832f Renerate /etc/rndc.key during named service startup if doesn't exist
- increase startup timeout in systemd units to 90sec (default)

Signed-off-by: Adam Tkac <atkac@redhat.com>
2012-12-20 14:34:39 +01:00

20 lines
462 B
Bash
Executable File

#!/bin/bash
. /etc/rc.d/init.d/functions
# This script generates /etc/rndc.key if doesn't exist
if [ ! -s /etc/rndc.key ]; then
echo -n $"Generating /etc/rndc.key:"
if /usr/sbin/rndc-confgen -a > /dev/null 2>&1; then
chmod 640 /etc/rndc.key
chown root.named /etc/rndc.key
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/rndc.key
success $"/etc/rndc.key generation"
echo
else
failure $"/etc/rndc.key generation"
echo
fi
fi