summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Vorel <petr.vorel@gmail.com>2019-07-08 22:16:06 +0200
committerPetr Vorel <petr.vorel@gmail.com>2019-07-12 06:19:49 +0200
commiteb8e3be9c395d4543a824fb645a2002ceaea665a (patch)
treec3d4a104097ea2d45ec13f9d82df0f13d193957c
parent13e00847176aa23683d68fce1d17ffb523510946 (diff)
downloadiputils-eb8e3be9c395d4543a824fb645a2002ceaea665a.tar.gz
ninfod: Cleanup startup script
* use printf (echo -n is not portable) * simplify executable check * remove trailing whitespace, redundant semicolon Acked-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
-rw-r--r--ninfod/ninfod.sh.in16
1 files changed, 5 insertions, 11 deletions
diff --git a/ninfod/ninfod.sh.in b/ninfod/ninfod.sh.in
index ccc1387..34c7655 100644
--- a/ninfod/ninfod.sh.in
+++ b/ninfod/ninfod.sh.in
@@ -3,26 +3,21 @@
NINFOD=@prefix@/sbin/ninfod
PID=/var/run/ninfod.pid
-if ! [ -x $NINFOD ]; then
- exit 0
-fi
+[ -x "$NINFOD" ] || exit 0
case "$1" in
start)
- echo -n "Starting node information daemon:"
- echo -n " ninfod" ;
- $NINFOD
+ printf "Starting node information daemon: ninfod"
+ $NINFOD
echo "."
;;
stop)
- echo -n "Stopping node information daemon:"
- echo -n " ninfod" ;
+ printf "Stopping node information daemon: ninfod"
kill `cat $PID`
echo "."
;;
restart)
- echo -n "Restarting node information daemon:"
- echo -n " ninfod"
+ printf "Restarting node information daemon: ninfod"
kill `cat $PID`
$NINFOD
echo "."
@@ -34,4 +29,3 @@ case "$1" in
esac
exit 0
-