From 23458b3db173e1a9fd47aae3b3cfeab245ee6f18 Mon Sep 17 00:00:00 2001 From: Petr Menšík Date: May 22 2020 10:18:30 +0000 Subject: Make usage of initscripts optional Do not depend hard on initscript just to provide fancy colored status. When started from systemd, it does not really matter. Return exactly the same return code as returned by the original tool. --- diff --git a/bind.spec b/bind.spec index 48f91e8..e533822 100644 --- a/bind.spec +++ b/bind.spec @@ -1159,6 +1159,7 @@ fi; %changelog * Wed May 20 2020 Petr Menšík - 32:9.16.3-1 - Update to 9.16.3 +- Make initscripts just optional dependency * Mon Apr 27 2020 Petr Menšík - 32:9.16.2-4 - Enable PKCS#11 builds again diff --git a/generate-rndc-key.sh b/generate-rndc-key.sh index 1ba0004..956bb8e 100755 --- a/generate-rndc-key.sh +++ b/generate-rndc-key.sh @@ -1,6 +1,17 @@ #!/bin/bash -. /etc/rc.d/init.d/functions +if [ -r /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions +else +success() { + echo $" OK " +} + +failure() { + echo -n " " + echo $"FAILED" +} +fi # This script generates /etc/rndc.key if doesn't exist AND if there is no rndc.conf @@ -14,8 +25,9 @@ if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then success $"/etc/rndc.key generation" echo else + rc=$? failure $"/etc/rndc.key generation" echo - exit 1 + exit $rc fi fi