10 # Source function library
11 . /etc/rc.d/init.d/functions
14 . /etc/sysconfig/network
17 [ -f /etc/sysconfig/ifplugd ] && . /etc/sysconfig/ifplugd
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then
22 msg_network_down ifplugd
29 [ -n "$2" ] && INTERFACES="$2"
31 [ -z "$INTERFACES" -o "$INTERFACES" = "auto" ] && INTERFACES=$(awk -F: '/(eth|wlan)/ { print $1 }' /proc/net/dev | xargs)
34 # See how we were called.
37 # Check if the service is already running?
38 for iface in $INTERFACES; do
39 if [ ! -f /var/lock/subsys/ifplugd.${iface} ]; then
40 msg_starting "Network Interface Plugging Daemon ($iface)"
41 args=$(eval echo \$\{ARGS_${IF}\})
42 [ -z "$args" ] && args="${ARGS}"
43 daemon /sbin/ifplugd -i ${iface} ${args}
45 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ifplugd.${iface}
47 msg_already_running "ifplugd ($iface)"
52 for iface in $INTERFACES; do
53 if [ -f /var/lock/subsys/ifplugd.${iface} ]; then
54 msg_stopping "Network Interface Plugging Daemon ($iface)"
55 daemon /sbin/ifplugd -k -i ${iface}
58 msg_not_running "ifplugd ($iface)"
61 rm -f /var/run/ifplugd.pid /var/lock/subsys/ifplugd.* >/dev/null 2>&1
64 for iface in $INTERFACES; do
65 if [ -f /var/lock/subsys/ifplugd.${iface} ]; then
66 msg_stopping "Network Interface Plugging Daemon (suspending $iface)"
67 daemon /sbin/ifplugd -S -i ${iface}
70 msg_not_running "ifplugd ($iface)"
75 for iface in $INTERFACES; do
76 if [ -f /var/lock/subsys/ifplugd.${iface} ]; then
77 msg_starting "Network Interface Plugging Daemon (resuming $iface)"
78 daemon /sbin/ifplugd -R -i ${iface}
81 msg_not_running "ifplugd ($iface)"
92 for iface in $INTERFACES; do
93 /sbin/ifplugd -c -i ${iface}
98 if [ -f /var/lock/subsys/ifplugd ]; then
104 msg_not_running ifplugd >&2
109 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"