047341e6eb
The test doesn't make sense. It just exits without any error if the binary doesn't exist, which is silly. Replace the NETWORKMANAGER_BIN variable, which was used only once, by the full path of the binary file. Drop the now useless variables prefix, exec_prefix and sbindir. Signed-off-by: Carlos Santos <casantos@datacom.ind.br> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
42 lines
751 B
Bash
Executable File
42 lines
751 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Allow a few customizations from a config file
|
|
test -r /etc/default/NetworkManager && . /etc/default/NetworkManager
|
|
|
|
PID=`pidof NetworkManager`
|
|
case "$1" in
|
|
start)
|
|
printf "Starting NetworkManager ... "
|
|
[ ! -d /var/run/NetworkManager ] && install -d /var/run/NetworkManager
|
|
if [ -z "$PID" ]; then
|
|
/usr/sbin/NetworkManager $NETWORKMANAGER_ARGS
|
|
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
|
|
|
|
|
|
|