Do not request use of urandom and report failure

Original script did not report failure as exit status. Report error if
rndc key generation failed also by exit status, not only by failed
message.

-r parameter is unsupported now, do not require it anymore.
This commit is contained in:
Petr Menšík 2020-05-11 18:09:54 +02:00
parent 775befed48
commit 8ad1379019

View File

@ -6,7 +6,7 @@
if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then
echo -n $"Generating /etc/rndc.key:" echo -n $"Generating /etc/rndc.key:"
if /usr/sbin/rndc-confgen -a -A hmac-sha256 -r /dev/urandom > /dev/null 2>&1 if /usr/sbin/rndc-confgen -a -A hmac-sha256 > /dev/null 2>&1
then then
chmod 640 /etc/rndc.key chmod 640 /etc/rndc.key
chown root:named /etc/rndc.key chown root:named /etc/rndc.key
@ -16,5 +16,6 @@ if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then
else else
failure $"/etc/rndc.key generation" failure $"/etc/rndc.key generation"
echo echo
exit 1
fi fi
fi fi