/[baselayout]/trunk/net.Linux/pppd.sh
Gentoo

Diff of /trunk/net.Linux/pppd.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2622 Revision 2623
49 fi 49 fi
50 ;; 50 ;;
51 esac 51 esac
52 52
53 eval $(_get_array "pppd_${IFVAR}") 53 eval $(_get_array "pppd_${IFVAR}")
54 opts=$(requote "$@") 54 opts="$@"
55 55
56 # We don't work with these options set by the user 56 local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersits=false
57 local hasupdetach=false
57 for i in "$@" ; do 58 for i in "$@" ; do
58 set -- ${i} 59 set -- ${i}
59 case "$1" in 60 case "$1" in
60 unit|nodetach|linkname) 61 unit|nodetach|linkname)
61 eerror "The option \"$1\" is not allowed in pppd_${IFVAR}" 62 eerror "The option \"$1\" is not allowed in pppd_${IFVAR}"
62 return 1 63 return 1
63 ;; 64 ;;
65 mtu) hasmtu=true ;;
66 mru) hasmru=true ;;
67 maxfail) hasmaxfail=true ;;
68 persist) haspersist=true ;;
69 updetach) hasupdetach=true;
64 esac 70 esac
65 done 71 done
66 72
67 # Might be set in conf.d/net 73 # Might be set in conf.d/net
68 local username= password= passwordset= 74 local username= password= passwordset=
72 if [ -n "${username}" ] \ 78 if [ -n "${username}" ] \
73 && [ -n "${password}" -o -z "${passwordset}" ] ; then 79 && [ -n "${password}" -o -z "${passwordset}" ] ; then
74 opts="${opts} plugin passwordfd.so passwordfd 0" 80 opts="${opts} plugin passwordfd.so passwordfd 0"
75 fi 81 fi
76 82
77 # Check for mtu/mru
78 local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersits=false
79 local hasupdetach=false
80 eval mtu=\$mtu_${IFVAR}
81 eval set -- "${opts}"
82 for i in "$@" ; do
83 case "${i}" in
84 mtu" "*) hasmtu=true ;;
85 mru" "*) hasmru=true ;;
86 maxfail" "*) hasmaxfail=true ;;
87 persist) haspersist=true ;;
88 updetach) hasupdetach=true;
89 esac
90 done
91 if [ -n "${mtu}" ] ; then 83 if [ -n "${mtu}" ] ; then
92 ! ${hasmtu} && opts="${opts} mtu ${mtu}" 84 ${hasmtu} || opts="${opts} mtu ${mtu}"
93 ! ${hasmru} && opts="${opts} mru ${mtu}" 85 ${hasmru} || opts="${opts} mru ${mtu}"
94 fi 86 fi
95 ! ${hasmailfail} && opts="${opts} maxfail 0" 87 ${hasmailfail} || opts="${opts} maxfail 0"
96 ! ${haspersist} && opts="${opts} persist" 88 ${haspersist} || opts="${opts} persist"
97 89
98 # Set linkname because we need /var/run/ppp-${linkname}.pid 90 # Set linkname because we need /var/run/ppp-${linkname}.pid
99 # This pidfile has the advantage of being there, 91 # This pidfile has the advantage of being there,
100 # even if ${IFACE} interface was never started 92 # even if ${IFACE} interface was never started
101 opts="linkname ${IFACE} ${opts}" 93 opts="linkname ${IFACE} ${opts}"
102 94
103 # Setup auth info 95 # Setup auth info
104 if [ -n "${username}" ] ; then 96 if [ -n "${username}" ] ; then
105 opts="user '"${username}"' remotename ${IFACE} ${opts}" 97 opts="user '${username}' remotename ${IFACE} ${opts}"
106 fi 98 fi
107 99
108 # Load a custom interface configuration file if it exists 100 # Load a custom interface configuration file if it exists
109 [ -f "/etc/ppp/options.${IFACE}" ] \ 101 [ -f "/etc/ppp/options.${IFACE}" ] \
110 && opts="${opts} file /etc/ppp/options.${IFACE}" 102 && opts="${opts} file /etc/ppp/options.${IFACE}"

Legend:
Removed from v.2622  
changed lines
  Added in v.2623

  ViewVC Help
Powered by ViewVC 1.1.20