]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/network
1e48af94942cca5b43ef1d352f0fe9fd11eaf098
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
)
20 /etc
/rc.d
/init.d
/dnsmasq start
21 /etc
/rc.d
/init.d
/static-routes start
27 if [ -n "${1}" ]; then
29 for i
in green red blue orange
; do
34 for i
in green red blue orange
; do
39 while [ ! $# = 0 ]; do
40 for i
in green red blue orange
; do
41 if [ "${i}" == "${1}" ]; then
50 [ "${ALL}" == "1" ] && init_networking
52 # Starting interfaces...
54 [ "$green" == "1" ] && /etc
/rc.d
/init.d
/networking
/green start
57 [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ] && \
58 /etc
/rc.d
/init.d
/networking
/blue start
61 [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "4" ] && \
62 /etc
/rc.d
/init.d
/networking
/orange start
65 if [ "$red" == "1" ]; then
66 if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
67 # Remove possible leftover files
68 rm -f /var
/ipfire
/red
/{active
,device
,dial-on-demand
,dns1
,dns2
,local-ipaddress
,remote-ipaddress
,resolv.conf
}
69 [ "$AUTOCONNECT" == "off" ] ||
/etc
/rc.d
/init.d
/networking
/red start
75 # Stopping interfaces...
77 [ "$green" == "1" ] && /etc
/rc.d
/init.d
/networking
/green stop
80 [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ] && \
81 /etc
/rc.d
/init.d
/networking
/blue stop
84 [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "4" ] && \
85 /etc
/rc.d
/init.d
/networking
/orange stop
88 if [ "$red" == "1" ]; then
89 if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
90 /etc
/rc.d
/init.d
/networking
/red stop
94 # Stopping dnsmasq if network all networks shutdown
95 [ "${ALL}" == "1" ] && /etc
/rc.d
/init.d
/dnsmasq stop
101 for i
in green red blue orange
; do
102 if [ "${!i}" == "1" ]; then
112 echo "Usage: ${0} {start|stop|restart} [device(s)]"
117 # End /etc/rc.d/init.d/network