kumquat-buildroot/package/network-manager/S45network-manager
André Erdmann 5065d475fb sysv init scripts: replace &>/dev/null redirection
"<command> &>/dev/null" is supposed to redirect all output to /dev/null.

However, in shells that don't support it (dash, ash without bash extensions),
a command like "echo a &>/dev/null" is interpreted as

(a) "echo a" in background
(b) write nothing to /dev/null (redirect <empty command> to /dev/null)

This commit replaces "&>..." with ">/dev/null 2>&1".

Signed-off-by: André Erdmann <dywi@mailerd.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-26 18:51:21 +01:00

47 lines
760 B
Bash
Executable File

#!/bin/sh
prefix=/usr
exec_prefix=/usr
sbindir=${exec_prefix}/sbin
NETWORKMANAGER_BIN=${sbindir}/NetworkManager
[ -x $NETWORKMANAGER_BIN ] || exit 0
PID=`pidof -o %PPID NetworkManager`
case "$1" in
start)
echo -n "Starting NetworkManager ... "
[ ! -d /var/run/NetworkManager ] && install -d /var/run/NetworkManager
if [ -z "$PID" ]; then
$NETWORKMANAGER_BIN
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
echo "failed!"
else
echo "done."
fi
;;
stop)
echo -n "Stopping NetworkManager ... "
[ ! -z "$PID" ] && kill $PID > /dev/null 2>&1
if [ $? -gt 0 ]; then
echo "failed!"
else
echo "done."
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart|sleep|wake}"
;;
esac
exit 0