Fix ppp config, #197775.

This commit is contained in:
Roy Marples 2007-11-02 11:02:07 +00:00
parent 220f6f8fdb
commit 7003483a91
3 changed files with 28 additions and 26 deletions

View File

@ -3,6 +3,7 @@
02 Nov 2007; Roy Marples <uberlord@gentoo.org>:
Fix ppp config, #197775.
Fix an ifconfig calculation for shells that don't support the newer
POSIX shell math expansion, #197856.

View File

@ -701,22 +701,22 @@
# Dial-up PPP users need to specify at least one telephone number
#phone_number_ppp0="12345689" # Maximum 2 phone numbers are supported
# They will also need a chat script - here's a good one
#chat_ppp0=" \
# 'ABORT' 'BUSY' \
# 'ABORT' 'ERROR' \
# 'ABORT' 'NO ANSWER' \
# 'ABORT' 'NO CARRIER' \
# 'ABORT' 'NO DIALTONE' \
# 'ABORT' 'Invalid Login' \
# 'ABORT' 'Login incorrect' \
# 'TIMEOUT' '5' \
# '' 'ATZ' \
# 'OK' 'AT' # Put your modem initialization string here \
# 'OK' 'ATDT\T' \
# 'TIMEOUT' '60' \
# 'CONNECT' '' \
# 'TIMEOUT' '5' \
# '~--' '' \
#chat_ppp0="
#ABORT BUSY
#ABORT ERROR
#ABORT 'NO ANSWER'
#ABORT 'NO CARRIER'
#ABORT 'NO DIALTONE'
#ABORT 'Invalid Login'
#ABORT 'Login incorrect'
#TIMEOUT 5
#'' ATZ
#OK AT # Put your modem initialization string here
#OK 'ATDT\T'
#TIMEOUT 60
#CONNECT ''
#TIMEOUT 5
#~-- ''
#"
# If the link require extra configuration - for example wireless or

View File

@ -33,7 +33,7 @@ pppd_pre_start() {
return 0
fi
local link= i= unit="${IFACE#ppp}" opts=
local link= i= unit="${IFACE#ppp}" opts=
# PPP requires a link to communicate over - normally a serial port
# PPPoE communicates over Ethernet
@ -57,7 +57,9 @@ pppd_pre_start() {
return 1
fi
eval opts=\$pppd_${IFVAR}
# We need to flatten the useless array
set -- $(_get_array "pppd_${IFVAR}")
opts="$@"
local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersist=false
local hasupdetach=false hasdefaultmetric=false
@ -117,16 +119,15 @@ pppd_pre_start() {
opts="unit ${unit} ${opts}"
# Setup connect script
local chatopts="/usr/sbin/chat -e -E -v" phone=
local chatprog="/usr/sbin/chat -e -E -v" phone=
eval phone=\$phone_number_${IFVAR}
set -- ${phone}
[ -n "$1" ] && chatopts="${chatopts} -T '$1'"
[ -n "$2" ] && chatopts="${chatopts} -U '$2'"
local chat="$(_get_array "chat_${IFVAR}")"
if [ "${chat}" ] ; then
local IFS="$__IFS"
opts="${opts} connect $(printf "\\'%s\\'" "${chatopts} $(printf "\\'\\\\'\\'%s\\'\\\'' " "$@")")"
unset IFS
[ -n "$1" ] && chatprog="${chatprog} -T '$1'"
[ -n "$2" ] && chatprog="${chatprog} -U '$2'"
# We need to flatten the useless array
set -- $(_get_array "chat_${IFVAR}")
if [ $# != 0 ]; then
opts="${opts} connect '$(echo ${chatprog} $@ | sed -e "s:':'\\\\'':g")'"
fi
# Add plugins