Fix ppp config, #197775.
This commit is contained in:
parent
220f6f8fdb
commit
7003483a91
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
02 Nov 2007; Roy Marples <uberlord@gentoo.org>:
|
02 Nov 2007; Roy Marples <uberlord@gentoo.org>:
|
||||||
|
|
||||||
|
Fix ppp config, #197775.
|
||||||
Fix an ifconfig calculation for shells that don't support the newer
|
Fix an ifconfig calculation for shells that don't support the newer
|
||||||
POSIX shell math expansion, #197856.
|
POSIX shell math expansion, #197856.
|
||||||
|
|
||||||
|
@ -701,22 +701,22 @@
|
|||||||
# Dial-up PPP users need to specify at least one telephone number
|
# Dial-up PPP users need to specify at least one telephone number
|
||||||
#phone_number_ppp0="12345689" # Maximum 2 phone numbers are supported
|
#phone_number_ppp0="12345689" # Maximum 2 phone numbers are supported
|
||||||
# They will also need a chat script - here's a good one
|
# They will also need a chat script - here's a good one
|
||||||
#chat_ppp0=" \
|
#chat_ppp0="
|
||||||
# 'ABORT' 'BUSY' \
|
#ABORT BUSY
|
||||||
# 'ABORT' 'ERROR' \
|
#ABORT ERROR
|
||||||
# 'ABORT' 'NO ANSWER' \
|
#ABORT 'NO ANSWER'
|
||||||
# 'ABORT' 'NO CARRIER' \
|
#ABORT 'NO CARRIER'
|
||||||
# 'ABORT' 'NO DIALTONE' \
|
#ABORT 'NO DIALTONE'
|
||||||
# 'ABORT' 'Invalid Login' \
|
#ABORT 'Invalid Login'
|
||||||
# 'ABORT' 'Login incorrect' \
|
#ABORT 'Login incorrect'
|
||||||
# 'TIMEOUT' '5' \
|
#TIMEOUT 5
|
||||||
# '' 'ATZ' \
|
#'' ATZ
|
||||||
# 'OK' 'AT' # Put your modem initialization string here \
|
#OK AT # Put your modem initialization string here
|
||||||
# 'OK' 'ATDT\T' \
|
#OK 'ATDT\T'
|
||||||
# 'TIMEOUT' '60' \
|
#TIMEOUT 60
|
||||||
# 'CONNECT' '' \
|
#CONNECT ''
|
||||||
# 'TIMEOUT' '5' \
|
#TIMEOUT 5
|
||||||
# '~--' '' \
|
#~-- ''
|
||||||
#"
|
#"
|
||||||
|
|
||||||
# If the link require extra configuration - for example wireless or
|
# If the link require extra configuration - for example wireless or
|
||||||
|
@ -33,7 +33,7 @@ pppd_pre_start() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
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
|
# PPP requires a link to communicate over - normally a serial port
|
||||||
# PPPoE communicates over Ethernet
|
# PPPoE communicates over Ethernet
|
||||||
@ -57,7 +57,9 @@ pppd_pre_start() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
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 mtu= hasmtu=false hasmru=false hasmaxfail=false haspersist=false
|
||||||
local hasupdetach=false hasdefaultmetric=false
|
local hasupdetach=false hasdefaultmetric=false
|
||||||
@ -117,16 +119,15 @@ pppd_pre_start() {
|
|||||||
opts="unit ${unit} ${opts}"
|
opts="unit ${unit} ${opts}"
|
||||||
|
|
||||||
# Setup connect script
|
# 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}
|
eval phone=\$phone_number_${IFVAR}
|
||||||
set -- ${phone}
|
set -- ${phone}
|
||||||
[ -n "$1" ] && chatopts="${chatopts} -T '$1'"
|
[ -n "$1" ] && chatprog="${chatprog} -T '$1'"
|
||||||
[ -n "$2" ] && chatopts="${chatopts} -U '$2'"
|
[ -n "$2" ] && chatprog="${chatprog} -U '$2'"
|
||||||
local chat="$(_get_array "chat_${IFVAR}")"
|
# We need to flatten the useless array
|
||||||
if [ "${chat}" ] ; then
|
set -- $(_get_array "chat_${IFVAR}")
|
||||||
local IFS="$__IFS"
|
if [ $# != 0 ]; then
|
||||||
opts="${opts} connect $(printf "\\'%s\\'" "${chatopts} $(printf "\\'\\\\'\\'%s\\'\\\'' " "$@")")"
|
opts="${opts} connect '$(echo ${chatprog} $@ | sed -e "s:':'\\\\'':g")'"
|
||||||
unset IFS
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add plugins
|
# Add plugins
|
||||||
|
Loading…
x
Reference in New Issue
Block a user