ppp revision 104980
1#!/bin/sh 2# 3# $FreeBSD: head/etc/rc.d/ppp 104980 2002-10-12 10:31:31Z schweikh $ 4# 5 6# PROVIDE: ppp-user 7# REQUIRE: network1 8# KEYWORD: FreeBSD 9 10. /etc/rc.subr 11 12name="ppp" 13rcvar="ppp_enable" 14start_cmd="ppp_start" 15stop_cmd=":" 16 17ppp_start() 18{ 19 # Establish ppp mode. 20 # 21 if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \ 22 -a "${ppp_mode}" != "dedicated" \ 23 -a "${ppp_mode}" != "background" ]; then 24 ppp_mode="auto" 25 fi 26 27 ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}" 28 29 # Switch on NAT mode? 30 # 31 case ${ppp_nat} in 32 [Yy][Ee][Ss]) 33 ppp_command="${ppp_command} -nat" 34 ;; 35 esac 36 37 ppp_command="${ppp_command} ${ppp_profile}" 38 39 echo "Starting ppp as \"${ppp_user}\"" 40 su -m ${ppp_user} -c "exec ${ppp_command}" 41 42 # Re-Sync ipfilter so it picks up any new network interfaces 43 # 44 /etc/rc.d/ipfilter resync 45} 46 47load_rc_config $name 48run_rc_command "$1" 49