14 command="/usr/sbin/${name}"
17 start_postcmd="ppp_poststart"
21 local _ppp_profile _ppp_mode _ppp_nat _ppp_unit
22 local _ppp_profile_cleaned _punct _punct_c
25 _ppp_profile_cleaned=$1
27 for _punct_c in $_punct; do
28 _ppp_profile_cleaned=`ltr ${_ppp_profile_cleaned} ${_punct_c} '_'`
31 # Check for ppp profile mode override.
33 eval _ppp_mode=\$ppp_${_ppp_profile_cleaned}_mode
34 if [ -z "$_ppp_mode" ]; then
38 # Check for ppp profile nat override.
40 eval _ppp_nat=\$ppp_${_ppp_profile_cleaned}_nat
41 if [ -z "$_ppp_nat" ]; then
47 if [ "${_ppp_mode}" != "ddial" -a "${_ppp_mode}" != "direct" \
48 -a "${_ppp_mode}" != "dedicated" \
49 -a "${_ppp_mode}" != "background" ]; then
53 rc_flags="-quiet -${_ppp_mode}"
59 rc_flags="$rc_flags -nat"
63 # Check for hard wired unit
64 eval _ppp_unit=\$ppp_${_ppp_profile_cleaned}_unit
65 if [ -n "${_ppp_unit}" ]; then
66 _ppp_unit="-unit${_ppp_unit}"
68 rc_flags="$rc_flags $_ppp_unit"
72 su -m $ppp_user -c "$command ${rc_flags} ${_ppp_profile}"
80 if [ -z "${_ppp_profile}" ]; then
81 _ppp_profile=$ppp_profile
84 echo -n "Starting PPP profile:"
86 for _p in $_ppp_profile; do
96 # Re-Sync ipfilter and pf so they pick up any new network interfaces
98 if [ -f /etc/rc.d/ipfilter ]; then
99 /etc/rc.d/ipfilter quietresync
101 if [ -f /etc/rc.d/pf ]; then
102 /etc/rc.d/pf quietresync
111 /bin/pkill -f "^${command}.*[[:space:]]${_ppp_profile}\$" || \
112 echo -n "(not running)"
116 local _ppp_profile _p
119 if [ -z "${_ppp_profile}" ]; then
120 _ppp_profile=$ppp_profile
123 echo -n "Stopping PPP profile:"
125 for _p in $_ppp_profile; do