13 desc="Point to Point Protocol"
15 command="/usr/sbin/${name}"
18 start_postcmd="ppp_poststart"
22 local _ppp_profile _ppp_mode _ppp_nat _ppp_unit
23 local _ppp_profile_cleaned _punct _punct_c
26 _ppp_profile_cleaned=$1
28 for _punct_c in $_punct; do
29 _ppp_profile_cleaned=`ltr ${_ppp_profile_cleaned} ${_punct_c} '_'`
32 # Check for ppp profile mode override.
34 eval _ppp_mode=\$ppp_${_ppp_profile_cleaned}_mode
35 if [ -z "$_ppp_mode" ]; then
39 # Check for ppp profile nat override.
41 eval _ppp_nat=\$ppp_${_ppp_profile_cleaned}_nat
42 if [ -z "$_ppp_nat" ]; then
48 if [ "${_ppp_mode}" != "ddial" -a "${_ppp_mode}" != "direct" \
49 -a "${_ppp_mode}" != "dedicated" \
50 -a "${_ppp_mode}" != "background" ]; then
54 rc_flags="-quiet -${_ppp_mode}"
60 rc_flags="$rc_flags -nat"
64 # Check for hard wired unit
65 eval _ppp_unit=\$ppp_${_ppp_profile_cleaned}_unit
66 if [ -n "${_ppp_unit}" ]; then
67 _ppp_unit="-unit${_ppp_unit}"
69 rc_flags="$rc_flags $_ppp_unit"
73 su -m $ppp_user -c "$command ${rc_flags} ${_ppp_profile}"
81 if [ -z "${_ppp_profile}" ]; then
82 _ppp_profile=$ppp_profile
85 echo -n "Starting PPP profile:"
87 for _p in $_ppp_profile; do
97 # Re-Sync ipfilter and pf so they pick up any new network interfaces
99 if [ -f /etc/rc.d/ipfilter ]; then
100 /etc/rc.d/ipfilter quietresync
102 if [ -f /etc/rc.d/pf ]; then
103 /etc/rc.d/pf quietresync
112 /bin/pkill -f "^${command}.*[[:space:]]${_ppp_profile}\$" || \
113 echo -n "(not running)"
117 local _ppp_profile _p
120 if [ -z "${_ppp_profile}" ]; then
121 _ppp_profile=$ppp_profile
124 echo -n "Stopping PPP profile:"
126 for _p in $_ppp_profile; do