]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/networking/red
Der MySQL-Server aktiviert und startet sich direkt bei der Installation.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / networking / red
index 68f495ae4cd07a2bc733144e9a280664dc5199d1..d8a06597c4fd6367e74846e18ad2c5519fdf4afc 100644 (file)
@@ -82,6 +82,11 @@ case "${1}" in
                        echo -n "${GATEWAY}" > /var/ipfire/red/remote-ipaddress
                        echo -n "${DNS1}" > /var/ipfire/red/dns1
                        echo -n "${DNS2}" > /var/ipfire/red/dns2
+                       touch /var/ipfire/red/active
+                       
+                       boot_mesg "Setting up default gateway ${GATEWAY}..."
+                       ip route add default via ${GATEWAY} dev ${DEVICE}
+                       evaluate_retval
                        
                        run_subdir ${rc_base}/init.d/networking/red.up/
                        
@@ -146,11 +151,15 @@ case "${1}" in
                
                        eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings)
                        
-                       boot_mesg "Bringing up the PPPoE interface on ${DEVICE}..."
-                       ip addr add 1.1.1.1/24 broadcast 1.1.1.255 dev ${DEVICE}
-                       
                        [ -c "/dev/ppp" ] || mknod /dev/ppp c 108 0
                        
+                       if [ "$TYPE" == "pppoe" ]; then                 
+                               boot_mesg "Bringing up the PPPoE interface on ${DEVICE}..."
+                               ip addr add 1.1.1.1/24 broadcast 1.1.1.255 dev ${DEVICE}
+                       else
+                               boot_mesg "Bringing up the PPP via ${TYPE} on ${COMPORT}..."
+                       fi
+                       
                        ###                      ###
                        ### Configuring the pppd ###
                        ###                      ###
@@ -187,6 +196,8 @@ case "${1}" in
                                AUTH="-chap"
                        elif [ "${AUTH}" == "chap" ]; then
                                AUTH="-pap"
+                       else
+                               AUTH=""
                        fi
        
                        ### Dial On Demand              
@@ -204,9 +215,15 @@ case "${1}" in
                                fi
                        fi
                        
-                       ### When using plugin the device has to be the last option
+                       ### When using pppoe-plugin the device has to be the last option
                        #
                        [ "${METHOD}" == "PPPOE_PLUGIN" ] && PLUGOPTS+=" ${DEVICE}"
+                       
+                       if [ "$TYPE" == "modem" ]; then
+                               PLUGOPTS=" /dev/${COMPORT} ${DTERATE} connect /etc/ppp/dialer"
+                       elif [ "$TYPE" == "serial" ]; then
+                               PLUGOPTS=" /dev/${COMPORT} ${DTERATE} connect /bin/true"
+                       fi
                
                        ### Standard PPP options we always use
                        #
@@ -215,6 +232,7 @@ case "${1}" in
                        PPP_STD_OPTIONS+=" mru ${MTU} noaccomp nodeflate nopcomp novj novjccomp"
                        PPP_STD_OPTIONS+=" nobsdcomp user ${USERNAME} lcp-echo-interval 20"
                        PPP_STD_OPTIONS+=" lcp-echo-failure 3 ${AUTH}"
+                       [ "${TYPE}" eq "pppoe" ] || PPP_STD_OPTIONS+=" lock modem crtscts user ${USERNAME}"
                        
                        ### Debugging
                        #
@@ -226,8 +244,10 @@ case "${1}" in
                        
                        ### PPPoE invocation
                        #
-                       PPPOE_CMD="/usr/sbin/pppoe -p /var/run/ppp-ipfire.pid.pppoe -I ${DEVICE}"
-                       PPPOE_CMD+=" -T 80 -U $PPPOE_SYNC $ACNAME $SERVICENAMEOPT"
+                       if [ "${TYPE}" == "pppoe" ]; then
+                               PPPOE_CMD="/usr/sbin/pppoe -p /var/run/ppp-ipfire.pid.pppoe -I ${DEVICE}"
+                               PPPOE_CMD+=" -T 80 -U $PPPOE_SYNC $ACNAME $SERVICENAMEOPT"
+                       fi
                        
                        ### Run everything
                        #
@@ -288,7 +308,10 @@ case "${1}" in
                
                elif [ "$TYPE" == "PPPOE" ]; then
                        boot_mesg "Bringing down the PPPoE interface on ${DEVICE}..."
-                       killproc /usr/sbin/pppd
+                       rm -f /var/ipfire/red/keepconnected
+                       kill -TERM /usr/sbin/pppd 2>/dev/null
+                       evaluate_retval
+                       sleep 5
                        
                        ip addr del 1.1.1.1/24 broadcast 1.1.1.255 dev ${DEVICE}