summaryrefslogtreecommitdiff
path: root/net/routinator/files/routinator.in
diff options
context:
space:
mode:
Diffstat (limited to 'net/routinator/files/routinator.in')
-rw-r--r--net/routinator/files/routinator.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/net/routinator/files/routinator.in b/net/routinator/files/routinator.in
new file mode 100644
index 000000000000..8b7547b06f94
--- /dev/null
+++ b/net/routinator/files/routinator.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: routinator
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name=routinator
+desc="RPKI signed route collector and validator"
+rcvar="routinator_enable"
+start_precmd=check_init
+command="%%PREFIX%%/bin/${name}"
+
+load_rc_config ${name}
+
+: ${name_enable=:"NO"}
+: ${wrkdir:="/var/routinator"}
+
+pidfile=${wrkdir}/${name}.pid
+routinator_config=${routinator_conf:-"%%ETCDIR%%/routinator.conf"}
+required_file=${routinator_config}
+command_args="-c ${routinator_config} --rsync-command=%%PREFIX%%/bin/rsync server -d --user %%USERS%% --group %%GROUPS%% --pid-file=${pidfile} --working-dir=${wrkdir}"
+
+check_init() {
+ if [ ! -d ${wrkdir}/tals ]; then
+ echo
+ echo -n "Need to initialize routinator with tals, "
+ echo "see man routinator"
+ echo
+ exit 1
+ fi
+}
+
+run_rc_command "$1"