]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/system/network
2 ########################################################################
3 # Begin $rc_base/init.d/network
5 # Description : Network Control Script
7 # Authors : Michael Tremer - mitch@ipfire.org
11 # Notes : Written for IPFire by its team
13 ########################################################################
17 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
22 if [ -n "${1}" ]; then
24 for i
in green red blue orange
; do
29 for i
in green red blue orange
; do
34 while [ ! $# = 0 ]; do
35 for i
in green red blue orange
; do
36 if [ "${i}" == "${1}" ]; then
45 # Starting interfaces...
47 [ "$green" == "1" ] && /etc
/rc.d
/init.d
/networking
/green start
50 [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ] && \
51 /etc
/rc.d
/init.d
/networking
/blue start
54 [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "4" ] && \
55 /etc
/rc.d
/init.d
/networking
/orange start
58 if [ "$red" == "1" ]; then
59 if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
60 # Remove possible leftover files
61 rm -f /var
/ipfire
/red
/{active
,device
,dial-on-demand
,dns1
,dns2
,local-ipaddress
,remote-ipaddress
,resolv.conf
}
62 [ "$AUTOCONNECT" == "off" ] ||
/etc
/rc.d
/init.d
/networking
/red start
66 /etc
/rc.d
/init.d
/static-routes start
70 # Stopping interfaces...
72 [ "$green" == "1" ] && /etc
/rc.d
/init.d
/networking
/green stop
75 [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ] && \
76 /etc
/rc.d
/init.d
/networking
/blue stop
79 [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "4" ] && \
80 /etc
/rc.d
/init.d
/networking
/orange stop
83 if [ "$red" == "1" ]; then
84 if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
85 /etc
/rc.d
/init.d
/networking
/red stop
93 for i
in green red blue orange
; do
94 if [ "${!i}" == "1" ]; then
104 echo "Usage: ${0} {start|stop|restart} [device(s)]"
109 # End /etc/rc.d/init.d/network