3 # netplugd This shell script takes care of starting and stopping
4 # the network plug management daemon.
7 # description: netplugd is a daemon for managing non-static network \
9 # processname: netplugd
10 # pidfile: /var/run/netplugd.pid
12 # Copyright 2003 Key Research, Inc.
14 # Source function library.
15 if [ -f /etc
/init.d
/functions
]; then
16 .
/etc
/init.d
/functions
17 elif [ -f /etc
/rc.d
/init.d
/functions
]; then
18 .
/etc
/rc.d
/init.d
/functions
21 # Source networking configuration.
22 if [ -f /etc
/sysconfig
/network
]; then
23 .
/etc
/sysconfig
/network
25 # Check that networking is up.
26 [ ${NETWORKING} = "no" ] && exit 0
27 elif [ ! -f /etc
/network
/interfaces
]; then
32 [ -x /sbin
/netplugd
] ||
exit 0
34 if [ -f /etc
/sysconfig
/netplugd
]; then
35 .
/etc
/sysconfig
/netplugd
38 # See how we were called.
42 printf "Starting network plug daemon: "
43 start-stop-daemon
-S -q -p /var
/run
/netplugd.pid
-x /sbin
/netplugd
${NETPLUGDARGS}
46 [ $RETVAL -eq 0 ] && touch /var
/lock
/subsys
/netplugd
50 printf "Shutting down network plug daemon: "
51 start-stop-daemon
-K -n netplugd
54 [ $RETVAL -eq 0 ] && rm -f /var
/lock
/subsys
/netplugd
61 [ -f /var
/lock
/subsys
/netplugd
] && $0 restart ||
:
64 echo "Usage: $0 {start|stop|restart}"