more pppd fixes

This commit is contained in:
Roy Marples 2007-04-18 14:42:40 +00:00
parent 6617d946ec
commit fb2f0495a6

View File

@ -51,9 +51,10 @@ pppd_start() {
esac esac
eval $(_get_array "pppd_${IFVAR}") eval $(_get_array "pppd_${IFVAR}")
opts=$(requote "$@") opts="$@"
# We don't work with these options set by the user local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersits=false
local hasupdetach=false
for i in "$@" ; do for i in "$@" ; do
set -- ${i} set -- ${i}
case "$1" in case "$1" in
@ -61,6 +62,11 @@ pppd_start() {
eerror "The option \"$1\" is not allowed in pppd_${IFVAR}" eerror "The option \"$1\" is not allowed in pppd_${IFVAR}"
return 1 return 1
;; ;;
mtu) hasmtu=true ;;
mru) hasmru=true ;;
maxfail) hasmaxfail=true ;;
persist) haspersist=true ;;
updetach) hasupdetach=true;
esac esac
done done
@ -74,26 +80,12 @@ pppd_start() {
opts="${opts} plugin passwordfd.so passwordfd 0" opts="${opts} plugin passwordfd.so passwordfd 0"
fi fi
# Check for mtu/mru
local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersits=false
local hasupdetach=false
eval mtu=\$mtu_${IFVAR}
eval set -- "${opts}"
for i in "$@" ; do
case "${i}" in
mtu" "*) hasmtu=true ;;
mru" "*) hasmru=true ;;
maxfail" "*) hasmaxfail=true ;;
persist) haspersist=true ;;
updetach) hasupdetach=true;
esac
done
if [ -n "${mtu}" ] ; then if [ -n "${mtu}" ] ; then
! ${hasmtu} && opts="${opts} mtu ${mtu}" ${hasmtu} || opts="${opts} mtu ${mtu}"
! ${hasmru} && opts="${opts} mru ${mtu}" ${hasmru} || opts="${opts} mru ${mtu}"
fi fi
! ${hasmailfail} && opts="${opts} maxfail 0" ${hasmailfail} || opts="${opts} maxfail 0"
! ${haspersist} && opts="${opts} persist" ${haspersist} || opts="${opts} persist"
# Set linkname because we need /var/run/ppp-${linkname}.pid # Set linkname because we need /var/run/ppp-${linkname}.pid
# This pidfile has the advantage of being there, # This pidfile has the advantage of being there,
@ -102,7 +94,7 @@ pppd_start() {
# Setup auth info # Setup auth info
if [ -n "${username}" ] ; then if [ -n "${username}" ] ; then
opts="user '"${username}"' remotename ${IFACE} ${opts}" opts="user '${username}' remotename ${IFACE} ${opts}"
fi fi
# Load a custom interface configuration file if it exists # Load a custom interface configuration file if it exists