]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/network
Erste Teile der neuen Netzwerkscripte.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / network
index d392c16f48967d41e1833f17972b6f45cfa90d40..a6c1584a974374aa0872f5f48766f78020006927 100644 (file)
@@ -6,7 +6,7 @@
 #
 # Authors     : Michael Tremer - m.s.tremer@googlemail.com
 #
-# Version     : 00.00
+# Version     : 01.00
 #
 # Notes       : Written for IPFire by its team
 #
 
 . /etc/sysconfig/rc
 . ${rc_functions}
-. /var/ipfire/ethernet/settings
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/dhcp/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/vpn/settings)
 
 case "${1}" in
        start)
-               boot_mesg "Loading MASQ helper modules"
-               modprobe iptable_nat
-               modprobe ip_conntrack
-               modprobe ip_conntrack_ftp
-               modprobe ip_nat_ftp
-               modprobe ip_conntrack_h323
-               modprobe ip_nat_h323
-               modprobe ip_conntrack_irc
-               modprobe ip_nat_irc
-               modprobe ip_conntrack_mms
-               modprobe ip_nat_mms
-               modprobe ip_conntrack_pptp
-               modprobe ip_nat_pptp
-               modprobe ip_conntrack_proto_gre
-               modprobe ip_nat_proto_gre
-               modprobe ip_conntrack_quake3
-               modprobe ip_nat_quake3
+               boot_mesg "Loading iptables helper modules"
+               modprobe iptable_nat || failed=1
+               modprobe ip_conntrack || failed=1
+               modprobe ip_conntrack_ftp || failed=1
+               modprobe ip_nat_ftp || failed=1
+               modprobe ip_conntrack_h323 || failed=1
+               modprobe ip_nat_h323 || failed=1
+               modprobe ip_conntrack_irc || failed=1
+               modprobe ip_nat_irc || failed=1
+               modprobe ip_conntrack_mms || failed=1
+               modprobe ip_nat_mms || failed=1
+               modprobe ip_conntrack_pptp || failed=1
+               modprobe ip_nat_pptp || failed=1
+               modprobe ip_conntrack_sip || failed=1
+               modprobe ip_nat_sip || failed=1
+               (exit ${failed})
+               evaluate_retval
 
                # Remove possible leftover files
-               rm -f CONFIG_ROOT/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
-
-               # This won't actually do anything unless a PCMCIA controller was
-               # detected at install time, because /etc/pcmcia.conf won't exist.
-               /etc/rc.d/rc.pcmcia start
-               # Now, just in case we found a PCMCIA USB controller, we'll need to reload
-               # the USB here.
-               /usr/local/bin/resetusb
-
-               # The 'for' loop force driver loading order
-               for NIC in 0 1 2 3; do
-                   ETHX="eth${NIC}"
-                   if [ "$GREEN_DEV" == "$ETHX" ]; then
-                       if [ "$GREEN_DRIVER" != "" ]; then
-                           modprobe $GREEN_DRIVER $GREEN_DRIVER_OPTIONS
-                           evaluate_retval
-                      fi
-                   fi
-                   if [ "$ORANGE_DEV" == "$ETHX" ]; then
-                       if [ "$ORANGE_DRIVER" != "" ]; then
-                           modprobe $ORANGE_DRIVER $ORANGE_DRIVER_OPTIONS
-                           evaluate_retval
-                       fi
-                   fi
-                   if [ "$BLUE_DEV" == "$ETHX" ]; then
-                       if [ "$BLUE_DRIVER" != "" ]; then
-                           modprobe $BLUE_DRIVER $BLUE_DRIVER_OPTIONS
-                           evaluate_retval
-                       fi
-                   fi
-                   if [ "$RED_DEV" == "$ETHX" ]; then
-                       if [ "$RED_DRIVER" != "" ]; then
-                           modprobe $RED_DRIVER $RED_DRIVER_OPTIONS
-                           evaluate_retval
-                       fi
-                   fi
-               done
-
-               if [ -d /proc/bus/pccard ]; then
-                       boot_mesg "Initializing PCMCIA cardbus modems"
-                       modprobe serial_cb
-                       evaluate_retval
-               fi
-
+               rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
+               
                boot_mesg "Setting up IPFire firewall rules"
-               /etc/rc.d/rc.firewall start
-               evaluate_retval
+               /etc/rc.d/init.d/firewall start; evaluate_retval
+
                boot_mesg "Setting up IP Accounting"
-               /etc/rc.d/helper/writeipac.pl
-               /usr/sbin/fetchipac -S
+               /etc/rc.d/helper/writeipac.pl || failed=1
+               /usr/sbin/fetchipac -S || failed=1 
+               (exit ${failed})
                evaluate_retval
+
                boot_mesg "Setting IPFire DMZ pinholes"
-               /usr/local/bin/setdmzholes
-               evaluate_retval
+               /usr/local/bin/setdmzholes; evaluate_retval
 
-               if [ "$BLUE_DEV" != "" ]; then
+               if [ "$CONFIG_TYPE" = "4" -o "$CONFIG_TYPE" = "5" -o "$CONFIG_TYPE" = "6" -o "$CONFIG_TYPE" = "7" ]; then
                        boot_mesg "Setting up wireless firewall rules"
-                       /usr/local/bin/restartwireless
-                       evaluate_retval
+                       /usr/local/bin/restartwireless; evaluate_retval
+               fi
+               
+               # Starting interfaces...
+               # GREEN
+               name=green /etc/rc.d/init.d/net/ifup
+               
+               # BLUE
+               if [ "$CONFIG_TYPE" = "4" -o "$CONFIG_TYPE" = "5" -o "$CONFIG_TYPE" = "6" -o "$CONFIG_TYPE" = "7" ]; then
+                       name=blue /etc/rc.d/init.d/net/ifup
+               fi
+               
+               # ORANGE
+               if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "5" -o "$CONFIG_TYPE" = "7" ]; then
+                       name=orange /etc/rc.d/init.d/net/ifup
+               fi
+               
+               # RED
+               if [ "$CONFIG_TYPE" = "2" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "6" -o "$CONFIG_TYPE" = "7" ]; then
+                       name=red /etc/rc.d/init.d/net/ifup
                fi
-
-               boot_mesg "Bringing network up..."
-               . /etc/rc.d/rc.netaddress.up
-
-               ;;
 
        stop)