]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/network
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / network
index 579cbe02619fe039c4465d37c562e99d54977081..7f27a65a8cb6c589678cfb7545de230b1eff9335 100644 (file)
 . ${rc_functions}
 eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 
+init_networking() {
+       boot_mesg "Loading firewall modules into the kernel"
+       modprobe iptable_nat || failed=1
+       for i in $(find /lib/modules/$(uname -r) -name nf_conntrack*); do
+               modprobe $(basename $i | cut -d. -f1) || failed=1
+       done
+       for i in $(find /lib/modules/$(uname -r) -name nf_nat*); do
+               modprobe $(basename $i | cut -d. -f1) || failed=1
+       done
+       (exit ${failed})
+       evaluate_retval
+
+       if [ -e /var/ipfire/main/disable_nf_sip ]; then
+               rmmod nf_nat_sip
+               rmmod nf_conntrack_sip
+       fi
+
+       boot_mesg "Setting up firewall"
+       /etc/rc.d/init.d/firewall start; evaluate_retval
+
+#      boot_mesg "Setting up traffic accounting"
+#      /etc/rc.d/helper/writeipac.pl || failed=1
+#      /usr/sbin/fetchipac -S || failed=1
+#      (exit ${failed})
+#      evaluate_retval
+
+       boot_mesg "Setting up DMZ pinholes"
+       /usr/local/bin/setdmzholes; evaluate_retval
+
+       if [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
+               boot_mesg "Setting up wireless firewall rules"
+               /usr/local/bin/wirelessctrl; evaluate_retval
+       fi
+
+       /etc/rc.d/init.d/dnsmasq start
+}
+
 DO="${1}"
 shift
 
@@ -85,6 +122,11 @@ case "${DO}" in
                                /etc/rc.d/init.d/networking/red stop
                        fi
                fi
+
+               # Stopping dnsmasq if network all networks shutdown
+               [ "${ALL}" == "1" ] && /etc/rc.d/init.d/dnsmasq stop
+
+               exit 0
                ;;
 
        restart)
@@ -104,37 +146,4 @@ case "${DO}" in
                ;;
 esac
 
-init_networking() {
-
-       boot_mesg "Loading firewall modules into the kernel"
-       modprobe iptable_nat || failed=1
-       for i in $(find /lib/modules/$(uname -r) -name ip_conntrack*); do
-               modprobe $i || failed=1
-       done
-       for i in $(find /lib/modules/$(uname -r) -name ip_nat*); do
-               modprobe $i || failed=1
-       done
-       (exit ${failed})
-       evaluate_retval
-                        
-       boot_mesg "Setting up firewall"
-       /etc/rc.d/init.d/firewall start; evaluate_retval
-
-       boot_mesg "Setting up traffic accounting"
-       /etc/rc.d/helper/writeipac.pl || failed=1
-       /usr/sbin/fetchipac -S || failed=1
-       (exit ${failed})
-       evaluate_retval
-
-       boot_mesg "Setting up DMZ pinholes"
-       /usr/local/bin/setdmzholes; evaluate_retval
-
-       if [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then
-               boot_mesg "Setting up wireless firewall rules"
-               /usr/local/bin/restartwireless; evaluate_retval
-       fi
-
-       /etc/rc.d/init.d/dnsmasq start
-}
-
 # End /etc/rc.d/init.d/network