]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/net/ifup
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
13 # Notes : the variables are passed to the scripts found
14 # in the services directory
16 ########################################################################
21 boot_mesg
"Bringing up the $name interface..."
25 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
27 if [ "$name" == "green" ]; then
29 elif [ "$name" == "blue" ]; then
31 elif [ "$name" == "orange" ]; then
32 DEVICE
="${ORANGE_DEV}"
33 elif [ "$name" == "red" ]; then
37 # Check if an interface is there...
38 if ip link show
${DEVICE} > /dev
/null
2>&1; then
39 link_status
=`ip link show ${DEVICE} 2> /dev/null`
40 if [ -n "${link_status}" ]; then
41 if ! echo "${link_status}" |
grep -q UP
; then
42 ip link
set ${DEVICE} up
47 boot_mesg
"Interface ${DEVICE} doesn't exist." ${FAILURE}
52 # Passing the variables to the script
53 if [ "$name" == "green" ]; then
54 NAME
=${name} ADDRESS=${GREEN_ADDRESS} NETMASK=${GREEN_NETMASK} \
55 NETADDRESS
=${GREEN_NETADDRESS} BROADCAST
=${GREEN_BROADCAST} \
56 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${GREEN_DEV} up
58 elif [ "$name" == "blue" ]; then
59 NAME
=${name} ADDRESS=${BLUE_ADDRESS} NETMASK=${BLUE_NETMASK} \
60 NETADDRESS
=${BLUE_NETADDRESS} BROADCAST
=${BLUE_BROADCAST} \
61 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${BLUE_DEV} up
63 elif [ "$name" == "orange" ]; then
64 NAME
=${name} ADDRESS=${ORANGE_ADDRESS} NETMASK=${ORANGE_NETMASK} \
65 NETADDRESS
=${ORANGE_NETADDRESS} BROADCAST
=${ORANGE_BROADCAST} \
66 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${ORANGE_DEV} up
68 elif [ "$name" == "red" ]; then
69 if [ "${RED_TYPE}" == "PPPOE" ]; then
70 NAME
=${name} /etc
/rc.d
/init.d
/net
/red
/pppoe
${RED_DEV} up
71 elif [ "${RED_TYPE}" == "PPTP" ]; then
73 elif [ "${RED_TYPE}" == "DHCP" ]; then
74 NAME
=${name} DHCP_HOSTNAME
=${RED_DHCP_HOSTNAME} \
75 DNS1
=${DNS1} DNS2
=${DNS2} \
76 PRINTIP
=yes PRINTALL
=yes \
77 /etc
/rc.d
/init.d
/net
/common
/dhcpcd
${RED_DEV} up
78 elif [ "${RED_TYPE}" == "STATIC" ]; then
79 NAME
=${name} ADDRESS=${RED_ADDRESS} NETMASK=${RED_NETMASK} \
80 NETADDRESS
=${RED_NETADDRESS} BROADCAST
=${RED_BROADCAST} \
81 DNS1
=${DNS1} DNS2=${DNS2} GATEWAY=${DEFAULT_GATEWAY} \
82 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${RED_DEV} up
85 /usr
/local
/bin
/dialctrl.pl up
86 /etc
/rc.d
/init.d
/net
/red
/update
91 # End $network_devices/ifup