2006-07-30 06:09:09 +03:00
|
|
|
scan_ppp() {
|
|
|
|
config_get ifname "$1" ifname
|
|
|
|
pppdev="${pppdev:-0}"
|
|
|
|
config_set "$1" device "$ifname"
|
|
|
|
config_set "$1" ifname "ppp$pppdev"
|
|
|
|
config_set "$1" unit "$pppdev"
|
|
|
|
}
|
|
|
|
|
|
|
|
start_pppd() {
|
|
|
|
local cfg="$1"; shift
|
|
|
|
config_get device "$cfg" device
|
|
|
|
config_get unit "$cfg" unit
|
|
|
|
config_get username "$cfg" username
|
|
|
|
config_get password "$cfg" password
|
|
|
|
config_get keepalive "$cfg" keepalive
|
2006-09-12 03:34:46 +03:00
|
|
|
interval="${keepalive%%*[, ]}"
|
2006-09-12 03:31:37 +03:00
|
|
|
[ "$interval" != "$keepalive" ] || interval=5
|
|
|
|
|
2006-07-30 06:09:09 +03:00
|
|
|
config_get demand "$cfg" demand
|
|
|
|
[ -n "$demand" ] && echo "nameserver 1.1.1.1" > /tmp/resolv.conf
|
|
|
|
/usr/sbin/pppd "$@" \
|
2006-09-12 03:34:46 +03:00
|
|
|
${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive##[, ]*}} \
|
2006-07-30 06:09:09 +03:00
|
|
|
${demand:+precompiled-active-filter /etc/ppp/filter demand idle }${demand:-persist} \
|
|
|
|
usepeerdns \
|
|
|
|
defaultroute \
|
|
|
|
replacedefaultroute \
|
2006-08-04 11:43:04 +03:00
|
|
|
${username:+user "$username" password "$password"} \
|
2006-07-30 06:09:09 +03:00
|
|
|
linkname "$cfg" \
|
|
|
|
ipparam "$cfg"
|
|
|
|
}
|