busybox: rework bootscripts

So the output of 'reboot' command does not spread over different lines.
This is basically a cosmetic change to make target's output on reboot a
bit more beautiful.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2014-03-12 19:41:16 +01:00
parent 2d2013e8da
commit 5f5d88e853
3 changed files with 47 additions and 39 deletions

View File

@ -1,39 +1,51 @@
#!/bin/sh
DAEMON=/sbin/acpid
NAME=acpid
DESC="Busybox ACPI daemon."
ARGS="-M /etc/acpi/acpid.map"
test -f $DAEMON || exit 0
#===============================================================================
#
# busybox-acpid
#
# Copyright (C) 2014 by Digi International Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
#
# !Description: Busybox acpid bootscript
#
#===============================================================================
set -e
DAEMON="/sbin/acpid"
NAME="acpid"
DESC="Busybox ACPI daemon"
ARGS="-M /etc/acpi/acpid.map"
[ -x "${DAEMON}" ] || exit 0
case "$1" in
start)
echo -n "starting $DESC: $NAME... "
echo -n "Starting $DESC: "
start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
echo "done."
echo "done"
;;
stop)
echo -n "stopping $DESC: $NAME... "
start-stop-daemon -K -n $NAME
echo "done."
echo -n "Stopping $DESC: "
start-stop-daemon -K -q -n $NAME
echo "done"
;;
restart)
echo -n "restarting $DESC: $NAME... "
$0 stop
$0 start
echo "done."
;;
reload)
echo -n "reloading $DESC: $NAME... "
echo -n "Reloading $DESC: "
killall -HUP $(basename ${DAEMON})
echo "done."
echo "done"
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
;;
esac
exit 0

View File

@ -31,14 +31,12 @@ case "$1" in
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon -K -n $NAME
start-stop-daemon -K -q -n $NAME
echo "done"
;;
restart)
echo -n "Restarting $DESC: "
$0 stop
$0 start
echo "done"
;;
reload)
echo -n "Reloading $DESC: "
@ -50,5 +48,3 @@ case "$1" in
exit 1
;;
esac
exit 0

View File