diff options
Diffstat (limited to 'net-misc/networkmanager/files/NetworkManagerDispatcher')
-rw-r--r-- | net-misc/networkmanager/files/NetworkManagerDispatcher | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/net-misc/networkmanager/files/NetworkManagerDispatcher b/net-misc/networkmanager/files/NetworkManagerDispatcher new file mode 100644 index 000000000000..24aa37b97f69 --- /dev/null +++ b/net-misc/networkmanager/files/NetworkManagerDispatcher @@ -0,0 +1,48 @@ +#!/sbin/runscript +# +# NetworkManagerDispatcher: NetworkManagerDispatcher daemon +# +# chkconfig: 345 98 02 +# description: This is a daemon for automatically executing certain +# actions, when switching networks +# +# processname: NetworkManagerDispatcher +# pidfile: /var/run/NetworkManagerDispatcher.pid + +prefix=/usr +exec_prefix=/usr +sbindir=${exec_prefix}/sbin + +NETWORKMANAGERDISPATCHER_BIN=${sbindir}/NetworkManagerDispatcher + +# Sanity checks. +[ -x $NETWORKMANAGERDISPATCHER_BIN ] || exit 0 + +# so we can rearrange this easily +processname=$NETWORKMANAGERDISPATCHER_BIN +pidfile=/var/run/NetworkManagerDispatcher.pid + +depend() { + need NetworkManager +} + +start() +{ + if [ -e ${pidfile} ]; then + rm -f ${pidfile} + fi + ebegin "Starting NetworkManagerDispatcher" + start-stop-daemon --start --quiet --exec ${processname} + eend $? + echo $(/bin/pidof NetworkManagerDispatcher) > ${pidfile} +} + +stop() +{ + ebegin "Stopping NetworkManagerDispatcher" + start-stop-daemon --stop --quiet --exec ${processname} --pidfile ${pidfile} + eend $? + if [ -e ${pidfile} ]; then + rm -f $pidfile + fi +} |