]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/net/ifdown
2 ########################################################################
3 # Begin $network_devices/ifdown
5 # Description : Interface Down
7 # Authors : Nathan Coulson - nathan@linuxfromscratch.org
8 # Kevin P. Fleming - kpfleming@linuxfromscratch.org
9 # Michael Tremer - mitch@ipfire.org
15 ########################################################################
19 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
21 if [ "$name" == "green" ]; then
23 elif [ "$name" == "blue" ]; then
25 elif [ "$name" == "orange" ]; then
26 DEVICE
="${ORANGE_DEV}"
27 elif [ "$name" == "red" ]; then
31 if ip link show
${DEVICE} > /dev
/null
2>&1
33 if [ "$name" == "green" ]; then
34 NAME
=${name} ADDRESS=${GREEN_ADDRESS} NETMASK=${GREEN_NETMASK}\
35 NETADDRESS
=${GREEN_NETADDRESS} BROADCAST
=${GREEN_BROADCAST} \
36 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${GREEN_DEV} down
38 elif [ "$name" == "blue" ]; then
39 NAME
=${name} ADDRESS=${BLUE_ADDRESS} NETMASK=${BLUE_NETMASK}\
40 NETADDRESS
=${BLUE_NETADDRESS} BROADCAST
=${BLUE_BROADCAST} \
41 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${BLUE_DEV} down
43 elif [ "$name" == "orange" ]; then
44 NAME
=${name} ADDRESS=${ORANGE_ADDRESS} NETMASK=${ORANGE_NETMASK}\
45 NETADDRESS
=${ORANGE_NETADDRESS} BROADCAST
=${ORANGE_BROADCAST} \
46 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${ORANGE_DEV} down
48 elif [ "$name" == "red" ]; then
49 if [ "${RED_TYPE}" == "PPPOE" ]; then
50 NAME
=${name} /etc
/rc.d
/init.d
/net
/red
/pppoe
${RED_DEV} down
51 elif [ "${RED_TYPE}" == "PPTP" ]; then
53 elif [ "${RED_TYPE}" == "DHCP" ]; then
54 NAME
=${name} DHCP_HOSTNAME
=${RED_DHCP_HOSTNAME} \
55 PRINTIP
=yes PRINTALL
=yes \
56 /etc
/rc.d
/init.d
/net
/common
/dhcpcd
${RED_DEV} down
57 elif [ "${RED_TYPE}" == "STATIC" ]; then
58 NAME
=${name} ADDRESS=${RED_ADDRESS} NETMASK=${RED_NETMASK}\
59 NETADDRESS
=${RED_NETADDRESS} BROADCAST
=${RED_BROADCAST} \
60 DNS1
=${DNS1} DNS2=${DNS2} GATEWAY=${DEFAULT_GATEWAY} \
61 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${RED_DEV} down
64 ### Cleanup the system when red goes down ###
65 /usr
/local
/bin
/dialctrl.pl down
66 rm -f /var
/ipfire
/red
/iface
70 boot_mesg
"Interface ${DEVICE} doesn't exist." ${WARNING}
74 link_status
=`ip link show $DEVICE 2> /dev/null`
75 if [ -n "${link_status}" ]; then
76 if echo "${link_status}" |
grep -q UP
; then
77 boot_mesg
"Bringing down the ${DEVICE} interface..."
78 ip link
set ${DEVICE} down
83 # End $network_devices/ifdown