Add startup script, to load rules from /etc/rctl.conf.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib (ealier version)
This commit is contained in:
Edward Tomasz Napierala 2011-03-30 18:32:45 +00:00
parent 6ec54a57b4
commit cb89c25099
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220167
2 changed files with 40 additions and 1 deletions

View File

@ -29,7 +29,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
pf pflog pfsync \
powerd power_profile ppp pppoed pwcheck \
quota \
random rarpd resolv rfcomm_pppd_server root \
random rarpd rctl resolv rfcomm_pppd_server root \
route6d routed routing rpcbind rtadvd rtsold rwho \
savecore sdpd securelevel sendmail \
serial sppp statd static_arp stf swap1 \

39
etc/rc.d/rctl Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: rctl
# BEFORE: LOGIN
# KEYWORD: nojail
. /etc/rc.subr
name="rctl"
start_cmd="rctl_start"
stop_cmd="rctl_stop"
rctl_start()
{
if [ -f /etc/rctl.conf ]; then
while read var comments
do
case ${var} in
\#*|'')
;;
*)
rctl -a "${var}"
;;
esac
done < /etc/rctl.conf
fi
}
rctl_stop()
{
rctl -r :
}
load_rc_config $name
run_rc_command "$1"