Add several important startup services
This commit is contained in:
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# PROVIDE: allow_hosts
|
||||
# REQUIRE: named
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
|
||||
. ${RC_ROUTER_HARNESS}/etc/rc.subr
|
||||
|
||||
name="allow_hosts"
|
||||
desc="Allow hosts by DNS (from local DNS)"
|
||||
|
||||
start_cmd='allow_hosts_start'
|
||||
stop_cmd='allow_hosts_stop'
|
||||
rcvar='allow_hosts_enable'
|
||||
|
||||
load_rc_config 'allow_hosts'
|
||||
|
||||
if [ -z "${allow_hosts_rules}" ]
|
||||
then
|
||||
echo "Must have a route policy target file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
allow_hosts_start()
|
||||
{
|
||||
echo "Running allow hosts"
|
||||
echo "include \"${allow_hosts_rules}\"" > /etc/router-conf/gen/pf.rules.conf
|
||||
pfctl -a allow-hosts -f ${allow_hosts_rules}
|
||||
}
|
||||
|
||||
allow_hosts_stop()
|
||||
{
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
|
||||
################ Epilogue
|
||||
|
||||
run_rc_command "$1"
|
||||
|
||||
# vim: ft=bash
|
||||
Reference in New Issue
Block a user