]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/networking/red
Korrektur MPFire CGI
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / networking / red
index d32793a150939f17a8c43d9c10b027da6b59d93d..e62c50d579c887f02c0feb360932da48d55c9e98 100644 (file)
@@ -28,8 +28,8 @@ if [ "$TYPE" == "STATIC" ]; then
        NETADDRESS="${RED_NETADDRESS}"
        NETMASK="${RED_NETMASK}"
        GATEWAY="${DEFAULT_GATEWAY}"
-       DNS1="${DNS1}"
-       DNS2="${DNS2}"
+       # DNS1
+       # DNS2
 
        if [ -z "${BROADCAST}" ]; then
                boot_mesg "BROADCAST variable missing from input, cannot continue." ${FAILURE}
@@ -77,6 +77,13 @@ case "${1}" in
                        boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..."
                        ip addr add ${args} dev ${DEVICE}
                        evaluate_retval
+                       echo -n "${DEVICE}" > /var/ipfire/red/iface
+                       echo -n "${ADDRESS}"  > /var/ipfire/red/local-ipaddress
+                       echo -n "${GATEWAY}" > /var/ipfire/red/remote-ipaddress
+                       echo -n "${DNS1}" > /var/ipfire/red/dns1
+                       echo -n "${DNS2}" > /var/ipfire/red/dns2
+                       
+                       run_subdir ${rc_base}/init.d/networking/red.up/
                        
                elif [ "${TYPE}" == "DHCP" ]; then
                        boot_mesg -n "Starting dhcpcd on the ${DEVICE} interface..."            
@@ -201,18 +208,6 @@ case "${1}" in
                        /usr/sbin/pppoe-start
                        evaluate_retval
                fi
-               
-               for i in $( ls -v ${rc_base}/init.d/networking/red.up/* 2> /dev/null); do
-                       check_script_status
-                       OUT=$(echo $(basename ${i}) | awk -F- '{ print $2 }')
-                       case "$OUT" in
-                               S) ${i} start   ;;
-                               K) ${i} stop ;;
-                               RS) ${i} restart ;;
-                               RL) ${i} reload ;;
-                               *) ${i} ;;
-                       esac
-               done
                ;;
 
        stop)
@@ -221,6 +216,8 @@ case "${1}" in
                        ip addr del ${args} dev ${DEVICE}
                        evaluate_retval
                        
+                       run_subdir ${rc_base}/init.d/networking/red.down/
+                       
                elif [ "$TYPE" == "DHCP" ]; then
                        boot_mesg -n "Stopping dhcpcd on the ${DEVICE} interface..."
                        if [ -e $LEASEINFO ]; then
@@ -273,17 +270,7 @@ case "${1}" in
                        fi
                fi
                
-               for i in $( ls -v ${rc_base}/init.d/networking/red.down/* 2> /dev/null); do
-                       check_script_status
-                       OUT=$(echo $(basename ${i}) | awk -F- '{ print $2 }')
-                       case "$OUT" in
-                               S) ${i} start   ;;
-                               K) ${i} stop ;;
-                               RS) ${i} restart ;;
-                               RL) ${i} reload ;;
-                               *) ${i} ;;
-                       esac
-               done
+               rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
                ;;
                
 esac