ljlinenoise: add hash file
[buildroot-gz.git] / package / netplug / S29netplug
blobd95554e8953580b85e1a41f1c78dae358732b390
1 #!/bin/sh
3 # netplugd This shell script takes care of starting and stopping
4 # the network plug management daemon.
6 # chkconfig: - 11 89
7 # description: netplugd is a daemon for managing non-static network \
8 # interfaces.
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
28 # No network support
29 exit 0
32 [ -x /sbin/netplugd ] || exit 0
34 if [ -f /etc/sysconfig/netplugd ]; then
35 . /etc/sysconfig/netplugd
38 # See how we were called.
39 case "$1" in
40 start)
41 # Start daemon.
42 echo -n "Starting network plug daemon: "
43 start-stop-daemon -S -q -p /var/run/netplugd.pid -x /sbin/netplugd ${NETPLUGDARGS}
44 RETVAL=$?
45 echo
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/netplugd
48 stop)
49 # Stop daemon.
50 echo -n "Shutting down network plug daemon: "
51 start-stop-daemon -K -n netplugd
52 RETVAL=$?
53 echo
54 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netplugd
56 restart|reload)
57 $0 stop
58 $0 start
60 condrestart)
61 [ -f /var/lock/subsys/netplugd ] && $0 restart || :
64 echo "Usage: $0 {start|stop|restart}"
65 RETVAL=1
67 esac
69 exit $RETVAL