freeipa/debian/generate-rndc-key.sh
Timo Aaltonen 9e85d20bc1 a bunch of changes
- add missing dependencies
- ship stub config files
- update platform code
- hack the path for dirsrv plugins (FIXME)
- use debian users for apache, bind
- add an initscript for ipa-memcached
- use dh_systemd
- ship generate-rndc-key.sh with the server
2014-09-12 14:19:13 +03:00

20 lines
571 B
Bash
Executable File

#!/bin/bash
. /lib/lsb/init-functions
# This script generates /etc/rndc.key if doesn't exist AND if there is no rndc.conf
if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then
echo -n $"Generating /etc/bind/rndc.key:"
if /usr/sbin/rndc-confgen -a -r /dev/urandom > /dev/null 2>&1; then
chmod 640 /etc/bind/rndc.key
chown root.bind /etc/bind/rndc.key
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/bind/rndc.key
log_success_msg "/etc/bind/rndc.key generation"
echo
else
log_failure_msg $"/etc/bind/rndc.key generation"
echo
fi
fi