diff -Pdpru rp-pppoe-3.14.orig/scripts/pppoe-setup.in rp-pppoe-3.14/scripts/pppoe-setup.in --- rp-pppoe-3.14.orig/scripts/pppoe-setup.in 2020-05-27 03:29:37.000000000 +0300 +++ rp-pppoe-3.14/scripts/pppoe-setup.in 2020-05-28 02:55:29.251934958 +0300 @@ -109,6 +109,42 @@ while [ true ] ; do fi echo "" + echo "MODEM TYPE" + echo "" + echo "We will try to detect if your modem is compliant with RFC 2516" + echo "or not. 3COM's 3CP4130 is *NOT* compliant, for instance." + echo "" + echo "Searching for a modem at interface $E..." + $PPPOE -A -I $E > /dev/null 2>&1 + if [ $? -eq 1 ]; then + # not found + # try 3COM's + echo "" + echo "Not found, trying with 3COM's code..." + result=`$PPPOE -A -I $E -f 3c12:3c13 2>/dev/null` + if [ $? -eq 0 ]; then + echo "Non-RFC2516 compliant modem found! Probably 3CP4130..." + echo "Probing for service name..." + service=`echo "$result" | grep Service-Name | grep -v "3Com DL Manager" | cut -d : -f 2` + if [ -n "$service" ]; then + echo "Found service name = $service" + PPPOE_EXTRA="-f 3c12:3c13 -S $service" + else + echo "Couldn't find a service name, proceeding without one..." + PPPOE_EXTRA="-f 3c12:3c13" + fi + else + echo "" + echo "Didn't find a modem at interface $E, you can continue but" + echo "things might not work as you expect... :(" + echo "You might want to re-run this script and try a different interface." + fi + else + echo "Found a RFC 2516 compliant modem, congratulations! :)" + PPPOE_EXTRA="" + fi + + echo "" echo "Do you want the link to come up on demand, or stay up continuously?" echo "If you want it to come up on demand, enter the idle time in seconds" echo "after which the link should be dropped. If you want the link to" @@ -220,6 +256,9 @@ while [ true ] ; do echo "** Summary of what you entered **" echo "" echo "Ethernet Interface: $E" + if [ -n "$PPPOE_EXTRA" ]; then + echo "Extra parameters for modem (autodetected): \"$PPPOE_EXTRA\"" + fi echo "User name: $U" if [ "$D" = "no" ] ; then echo "Activate-on-demand: No" @@ -296,6 +335,7 @@ sed -e "s&^USER=.*&USER='$U'&" \ -e "s/^DNS1=.*/DNS1=$DNS1/" \ -e "s/^DNS2=.*/DNS2=$DNS2/" \ -e "s/^PEERDNS=.*/PEERDNS=$PEERDNS/" \ + -e "s/^PPPOE_EXTRA=.*/PPPOE_EXTRA=\"$PPPOE_EXTRA\"/" \ < $CONFIG-bak > $CONFIG if [ $? != 0 ] ; then