]>
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
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
)
28 if [ "$name" == "green" ]; then
30 elif [ "$name" == "blue" ]; then
32 elif [ "$name" == "orange" ]; then
33 DEVICE
="${ORANGE_DEV}"
34 elif [ "$name" == "red" ]; then
38 # Check if an interface is there...
39 if ip link show
${DEVICE} > /dev
/null
2>&1; then
40 link_status
=`ip link show ${DEVICE} 2> /dev/null`
41 if [ -n "${link_status}" ]; then
42 if ! echo "${link_status}" |
grep -q UP
; then
43 ip link
set ${DEVICE} up
48 boot_mesg
"Interface ${DEVICE} doesn't exist." ${FAILURE}
53 # Passing the variables to the script
54 if [ "$name" == "green" ]; then
55 if [ "${CONFIG_TYPE}" == "0" ] ||
[ "${CONFIG_TYPE}" == "" ]; then
56 NAME
=${name} ADDRESS=${GREEN_ADDRESS} NETMASK=${GREEN_NETMASK} \
57 NETADDRESS
=${GREEN_NETADDRESS} BROADCAST
=${GREEN_BROADCAST} \
58 DNS1
=${DNS1} DNS2=${DNS2} GATEWAY=${DEFAULT_GATEWAY} \
59 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${GREEN_DEV} up
61 NAME
=${name} ADDRESS=${GREEN_ADDRESS} NETMASK=${GREEN_NETMASK} \
62 NETADDRESS
=${GREEN_NETADDRESS} BROADCAST
=${GREEN_BROADCAST} \
63 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${GREEN_DEV} up
66 elif [ "$name" == "blue" ]; then
67 NAME
=${name} ADDRESS=${BLUE_ADDRESS} NETMASK=${BLUE_NETMASK} \
68 NETADDRESS
=${BLUE_NETADDRESS} BROADCAST
=${BLUE_BROADCAST} \
69 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${BLUE_DEV} up
71 elif [ "$name" == "orange" ]; then
72 NAME
=${name} ADDRESS=${ORANGE_ADDRESS} NETMASK=${ORANGE_NETMASK} \
73 NETADDRESS
=${ORANGE_NETADDRESS} BROADCAST
=${ORANGE_BROADCAST} \
74 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${ORANGE_DEV} up
76 elif [ "$name" == "red" ]; then
77 if [ "${RED_TYPE}" == "PPPOE" ]; then
78 NAME
=${name} /etc
/rc.d
/init.d
/net
/red
/pppoe
${RED_DEV} up
79 elif [ "${RED_TYPE}" == "PPTP" ]; then
81 elif [ "${RED_TYPE}" == "DHCP" ]; then
82 NAME
=${name} DHCP_HOSTNAME
=${RED_DHCP_HOSTNAME} \
83 DNS1
=${DNS1} DNS2
=${DNS2} \
84 PRINTIP
=yes PRINTALL
=yes \
85 /etc
/rc.d
/init.d
/net
/common
/dhcpcd
${RED_DEV} up
86 elif [ "${RED_TYPE}" == "STATIC" ]; then
87 NAME
=${name} ADDRESS=${RED_ADDRESS} NETMASK=${RED_NETMASK} \
88 NETADDRESS
=${RED_NETADDRESS} BROADCAST
=${RED_BROADCAST} \
89 DNS1
=${DNS1} DNS2=${DNS2} GATEWAY=${DEFAULT_GATEWAY} \
90 /etc
/rc.d
/init.d
/net
/common
/ipv4-static
${RED_DEV} up
91 touch /var
/ipfire
/red
/active
94 /usr
/local
/bin
/dialctrl.pl up
95 /etc
/rc.d
/init.d
/net
/red
/update
100 # End $network_devices/ifup