aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/noc/files/noc.in
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/noc/files/noc.in')
-rw-r--r--net-mgmt/noc/files/noc.in56
1 files changed, 56 insertions, 0 deletions
diff --git a/net-mgmt/noc/files/noc.in b/net-mgmt/noc/files/noc.in
new file mode 100644
index 000000000000..dad6a3fc9c02
--- /dev/null
+++ b/net-mgmt/noc/files/noc.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: noc
+# REQUIRE: DAEMON %%RCLDCONFIG%%
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable noc:
+# noc_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable noc.
+#
+
+. /etc/rc.subr
+
+name="noc"
+rcvar=noc_enable
+
+# set defaults
+
+load_rc_config $name
+
+: ${noc_enable="NO"}
+: ${noc_config="%%NOCDIR%%/etc/noc-launcher.conf"}
+: ${noc_flags="-c ${noc_config}"}
+
+export PATH=$PATH:%%PYTHONBASE%%/bin
+
+noc_chdir=%%NOCDIR%%
+command=%%NOCDIR%%/scripts/noc-launcher.py
+command_interpreter=python
+pidfile=%%LOCALSTATE_DIR%%/noc-launcher.pid
+required_files=${noc_config}
+
+command_args=$1
+
+case "$command_args" in
+ force*)
+ command_args=${command_args#force};
+ ;;
+ fast*)
+ command_args=${command_args#fast};
+ ;;
+ restart)
+ command_args="stop"
+ run_rc_command "stop"
+ command_args="start"
+ run_rc_command "start"
+ exit 0
+ ;;
+esac
+
+run_rc_command "$1"