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