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:
parent
2d2013e8da
commit
5f5d88e853
|
|
@ -1,39 +1,51 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
DAEMON=/sbin/acpid
|
#===============================================================================
|
||||||
NAME=acpid
|
#
|
||||||
DESC="Busybox ACPI daemon."
|
# busybox-acpid
|
||||||
ARGS="-M /etc/acpi/acpid.map"
|
#
|
||||||
|
# Copyright (C) 2014 by Digi International Inc.
|
||||||
test -f $DAEMON || exit 0
|
# 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
|
set -e
|
||||||
|
|
||||||
case "$1" in
|
DAEMON="/sbin/acpid"
|
||||||
start)
|
NAME="acpid"
|
||||||
echo -n "starting $DESC: $NAME... "
|
DESC="Busybox ACPI daemon"
|
||||||
start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
|
ARGS="-M /etc/acpi/acpid.map"
|
||||||
echo "done."
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
echo -n "stopping $DESC: $NAME... "
|
|
||||||
start-stop-daemon -K -n $NAME
|
|
||||||
echo "done."
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
echo -n "restarting $DESC: $NAME... "
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
echo "done."
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
echo -n "reloading $DESC: $NAME... "
|
|
||||||
killall -HUP $(basename ${DAEMON})
|
|
||||||
echo "done."
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|restart|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
[ -x "${DAEMON}" ] || exit 0
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting $DESC: "
|
||||||
|
start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
|
||||||
|
echo "done"
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n "Stopping $DESC: "
|
||||||
|
start-stop-daemon -K -q -n $NAME
|
||||||
|
echo "done"
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
echo -n "Reloading $DESC: "
|
||||||
|
killall -HUP $(basename ${DAEMON})
|
||||||
|
echo "done"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|restart|reload}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
||||||
|
|
@ -31,14 +31,12 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Stopping $DESC: "
|
echo -n "Stopping $DESC: "
|
||||||
start-stop-daemon -K -n $NAME
|
start-stop-daemon -K -q -n $NAME
|
||||||
echo "done"
|
echo "done"
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
echo -n "Restarting $DESC: "
|
|
||||||
$0 stop
|
$0 stop
|
||||||
$0 start
|
$0 start
|
||||||
echo "done"
|
|
||||||
;;
|
;;
|
||||||
reload)
|
reload)
|
||||||
echo -n "Reloading $DESC: "
|
echo -n "Reloading $DESC: "
|
||||||
|
|
@ -50,5 +48,3 @@ case "$1" in
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue