]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/net/ifup
3866a04d79bc16d220d49107d052e715f8dab181
2 ########################################################################
3 # Begin $network_devices/ifup
5 # Description : Interface Up
7 # Authors : Nathan Coulson - nathan@linuxfromscratch.org
8 # Kevin P. Fleming - kpfleming@linuxfromscratch.org
9 # Michael Tremer - mitch@ipfire.org
10 # Maniacikarus - Maniacikarus@ipfire.org
14 # Notes : the variables are passed to the scripts found
15 # in the services directory
17 ########################################################################
22 boot_mesg
"Bringing up the $name interface..."
26 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
27 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
29 if [ "$name" == "green" ]; then
31 elif [ "$name" == "blue" ]; then
33 elif [ "$name" == "orange" ]; then
34 DEVICE
="${ORANGE_DEV}"
35 elif [ "$name" == "red" ]; then
39 # Check if an interface is there...
40 if ip link show
${DEVICE} > /dev
/null
2>&1; then
41 link_status
=`ip link show ${DEVICE} 2> /dev/null`
42 if [ -n "${link_status}" ]; then
43 if ! echo "${link_status}" |
grep -q UP
; then
44 ip link
set ${DEVICE} up
49 boot_mesg
"Interface ${DEVICE} doesn't exist." ${FAILURE}
54 # Passing the variables to the script
55 if [ "$name" == "green" ]; then
56 if [ "${CONFIG_TYPE}" == "0" ] ||
[ "${CONFIG_TYPE}" == "" ]; then
57 NAME
=${name} ADDRESS=${GREEN_ADDRESS} NETMASK=${GREEN_NETMASK} \
58 NETADDRESS
=${GREEN_NETADDRESS} BROADCAST
=${GREEN_BROADCAST} \
59 DNS1
=${DNS1} DNS2=${DNS2} GATEWAY=${DEFAULT_GATEWAY} \
60 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${GREEN_DEV} up
62 NAME
=${name} ADDRESS=${GREEN_ADDRESS} NETMASK=${GREEN_NETMASK} \
63 NETADDRESS
=${GREEN_NETADDRESS} BROADCAST
=${GREEN_BROADCAST} \
64 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${GREEN_DEV} up
67 if [ "${ENABLE_GREEN}" == "on" ]; then
68 boot_mesg
"Bringing up dhcpd on device ${DEVICE}."
69 /etc
/rc.d
/init.d
/net
/common
/dhcpd
${GREEN_DEV} up
72 elif [ "$name" == "blue" ]; then
73 NAME
=${name} ADDRESS=${BLUE_ADDRESS} NETMASK=${BLUE_NETMASK} \
74 NETADDRESS
=${BLUE_NETADDRESS} BROADCAST
=${BLUE_BROADCAST} \
75 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${BLUE_DEV} up
77 if [ "${ENABLE_BLUE}" == "on" ]; then
78 boot_mesg
"Bringing up dhcpd on device ${DEVICE}."
79 /etc
/rc.d
/init.d
/net
/common
/dhcpd
${BLUE_DEV} up
82 elif [ "$name" == "orange" ]; then
83 NAME
=${name} ADDRESS=${ORANGE_ADDRESS} NETMASK=${ORANGE_NETMASK} \
84 NETADDRESS
=${ORANGE_NETADDRESS} BROADCAST
=${ORANGE_BROADCAST} \
85 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${ORANGE_DEV} up
87 if [ "${ENABLE_ORANGE}" == "on" ]; then
88 boot_mesg
"Bringing up dhcpd on device ${DEVICE}."
89 /etc
/rc.d
/init.d
/net
/common
/dhcpd
${ORANGE_DEV} up
92 elif [ "$name" == "red" ]; then
93 if [ "${RED_TYPE}" == "PPPOE" ]; then
94 NAME
=${name} /etc
/rc.d
/init.d
/net
/red
/pppoe
${RED_DEV} up
95 elif [ "${RED_TYPE}" == "PPTP" ]; then
97 elif [ "${RED_TYPE}" == "DHCP" ]; then
98 NAME
=${name} DHCP_HOSTNAME
=${RED_DHCP_HOSTNAME} \
99 DNS1
=${DNS1} DNS2
=${DNS2} \
100 PRINTIP
=yes PRINTALL
=yes \
101 /etc
/rc.d
/init.d
/net
/common
/dhcpcd
${RED_DEV} up
102 elif [ "${RED_TYPE}" == "STATIC" ]; then
103 NAME
=${name} ADDRESS=${RED_ADDRESS} NETMASK=${RED_NETMASK} \
104 NETADDRESS
=${RED_NETADDRESS} BROADCAST
=${RED_BROADCAST} \
105 DNS1
=${DNS1} DNS2=${DNS2} GATEWAY=${DEFAULT_GATEWAY} \
106 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${RED_DEV} up
109 /usr
/local
/bin
/dialctrl.pl up
110 /etc
/rc.d
/init.d
/net
/red
/update
115 # End $network_devices/ifup