mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-02-25 12:02:12 +00:00
Sometimes it is useful to pass some parameters to NetworkManager when it starts (e.g. --log-level) instead of editting NetworkManager.conf. Allow the user add a file with a NETWORKMANAGER_ARGS variable containing such flags. This is simpler than overriding the whole startup script (e.g. by means of a rootfs overlay). Signed-off-by: Carlos Santos <casantos@datacom.ind.br> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
50 lines
888 B
Bash
Executable File
50 lines
888 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Allow a few customizations from a config file
|
|
test -r /etc/default/NetworkManager && . /etc/default/NetworkManager
|
|
|
|
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 $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
|
|
|
|
|
|
|