summaryrefslogtreecommitdiff
path: root/net/cjdns/files/cjdns.in
diff options
context:
space:
mode:
Diffstat (limited to 'net/cjdns/files/cjdns.in')
-rw-r--r--net/cjdns/files/cjdns.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/net/cjdns/files/cjdns.in b/net/cjdns/files/cjdns.in
new file mode 100644
index 000000000000..e4dc1a0ae94f
--- /dev/null
+++ b/net/cjdns/files/cjdns.in
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: cjdns
+# REQUIRE: LOGIN
+
+. /etc/rc.subr
+
+name="cjdns"
+rcvar=cjdns_enable
+command="%%PREFIX%%/bin/cjdroute"
+command_args="< %%PREFIX%%/etc/cjdroute.conf"
+
+if expr "$1" : ".*start" > /dev/null && ! [ -r %%PREFIX%%/etc/cjdroute.conf ]; then
+ %%PREFIX%%/bin/cjdroute --genconf > %%PREFIX%%/etc/cjdroute.conf &&
+ echo "$name: (!!!) generated the initial config file %%PREFIX%%/etc/cjdroute.conf" &&
+ echo "$name: (!!!) keep this file secret because it contains your secret key"
+ chmod 0600 %%PREFIX%%/etc/cjdroute.conf
+fi
+
+load_rc_config $name
+run_rc_command "$1"