3 # netplug - policy agent for netplugd
5 # Copyright 2003 Key Research, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License, version 2, as
9 # published by the Free Software Foundation. You are forbidden from
10 # redistributing or modifying it under the terms of any other license,
11 # including other versions of the GNU General Public License.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
19 PATH
=/usr
/bin
:/bin
:/usr
/sbin
:/sbin
27 if [ -x /sbin
/ifup
]; then
30 echo "Please teach me how to plug in an interface!" 1>&2
35 if [ -x /sbin
/ifdown
]; then
36 # At least on Fedora Core 1, the call to ip addr flush infloops
37 # /sbin/ifdown $dev && exec /sbin/ip addr flush $dev
38 exec /sbin
/ifdown
$dev
40 echo "Please teach me how to unplug an interface!" 1>&2
45 # exec /sbin/ip link set $dev up >/dev/null 2>&1
46 if [ -x /sbin
/ifconfig
]; then
47 exec /sbin
/ifconfig
$dev up
>/dev
/null
2>&1
49 echo "Failed to probe an interface!" 1>&2
54 echo "I have been called with a funny action of '%s'!" 1>&2