diff options
author | trasz <trasz@FreeBSD.org> | 2011-03-30 18:32:45 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2011-03-30 18:32:45 +0000 |
commit | d881081128369bb6e195fe45a2996aac7631fb75 (patch) | |
tree | 1ba7da3718d32c6b9c709b3f64e949ded868eb80 | |
parent | b43344bc6ae37a8faa817ff1e253d86c768097b2 (diff) | |
download | FreeBSD-src-d881081128369bb6e195fe45a2996aac7631fb75.zip FreeBSD-src-d881081128369bb6e195fe45a2996aac7631fb75.tar.gz |
Add startup script, to load rules from /etc/rctl.conf.
Sponsored by: The FreeBSD Foundation
Reviewed by: kib (ealier version)
-rw-r--r-- | etc/rc.d/Makefile | 2 | ||||
-rwxr-xr-x | etc/rc.d/rctl | 39 |
2 files changed, 40 insertions, 1 deletions
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index ed10b87..887db41 100644 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -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 \ diff --git a/etc/rc.d/rctl b/etc/rc.d/rctl new file mode 100755 index 0000000..4fa0579 --- /dev/null +++ b/etc/rc.d/rctl @@ -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" |