0f75b2635e
'echo -n' is not a POSIX construct (no flag support), we shoud use 'printf', especially in init script. This patch was generated by the following command line: git grep -l 'echo -n' -- `git ls-files | grep -v 'patch'` | xargs sed -i 's/echo -n/printf/' Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
47 lines
749 B
Bash
Executable File
47 lines
749 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 NetworkManager`
|
|
case "$1" in
|
|
start)
|
|
printf "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)
|
|
printf "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
|
|
|
|
|
|
|