2012-12-20 13:34:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
2013-08-16 11:08:20 +00:00
|
|
|
# This script generates /etc/rndc.key if doesn't exist AND if there is no rndc.conf
|
2012-12-20 13:34:39 +00:00
|
|
|
|
2013-08-16 11:08:20 +00:00
|
|
|
if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then
|
2012-12-20 13:34:39 +00:00
|
|
|
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
|