]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/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
)
20 /etc
/rc.d
/init.d
/dnsmasq start
26 if [ -n "${1}" ]; then
28 for i
in green red blue orange
; do
33 for i
in green red blue orange
; do
38 while [ ! $# = 0 ]; do
39 for i
in green red blue orange
; do
40 if [ "${i}" == "${1}" ]; then
49 [ "${ALL}" == "1" ] && init_networking
51 # Starting interfaces...
53 [ "$green" == "1" ] && /etc
/rc.d
/init.d
/networking
/green start
56 [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ] && \
57 /etc
/rc.d
/init.d
/networking
/blue start
60 [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "4" ] && \
61 /etc
/rc.d
/init.d
/networking
/orange start
64 if [ "$red" == "1" ]; then
65 if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
66 # Remove possible leftover files
67 rm -f /var
/ipfire
/red
/{active
,device
,dial-on-demand
,dns1
,dns2
,local-ipaddress
,remote-ipaddress
,resolv.conf
}
68 [ "$AUTOCONNECT" == "off" ] ||
/etc
/rc.d
/init.d
/networking
/red start
72 /etc
/rc.d
/init.d
/static-routes start
76 # Stopping interfaces...
78 [ "$green" == "1" ] && /etc
/rc.d
/init.d
/networking
/green stop
81 [ "$blue" == "1" ] && [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ] && \
82 /etc
/rc.d
/init.d
/networking
/blue stop
85 [ "$orange" == "1" ] && [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "4" ] && \
86 /etc
/rc.d
/init.d
/networking
/orange stop
89 if [ "$red" == "1" ]; then
90 if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
91 /etc
/rc.d
/init.d
/networking
/red stop
95 # Stopping dnsmasq if network all networks shutdown
96 [ "${ALL}" == "1" ] && /etc
/rc.d
/init.d
/dnsmasq stop
102 for i
in green red blue orange
; do
103 if [ "${!i}" == "1" ]; then
113 echo "Usage: ${0} {start|stop|restart} [device(s)]"
118 # End /etc/rc.d/init.d/network