mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-23 15:30:37 +01:00
53 lines
1.1 KiB
Text
53 lines
1.1 KiB
Text
|
|
#!/sbin/runscript
|
||
|
|
#
|
||
|
|
# NetworkManagerDispatcher: NetworkManagerDispatcher daemon
|
||
|
|
#
|
||
|
|
# chkconfig: 345 98 02
|
||
|
|
# description: This is a daemon for automatically executing scripts \
|
||
|
|
# when network connections change. \
|
||
|
|
#
|
||
|
|
# processname: NetworkManagerDispatcher
|
||
|
|
# pidfile: /var/run/NetworkManagerDispatcher.pid
|
||
|
|
#
|
||
|
|
### BEGIN INIT INFO
|
||
|
|
# Provides: networkmanager-dispatcher
|
||
|
|
### END INIT INFO
|
||
|
|
|
||
|
|
prefix=@prefix@
|
||
|
|
exec_prefix=@prefix@
|
||
|
|
sbindir=@sbindir@
|
||
|
|
|
||
|
|
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
|
||
|
|
}
|