]> Sergey Matveev's repositories - uploader.git/commitdiff
Example FreeBSD startup script
authorSergey Matveev <stargrave@stargrave.org>
Thu, 2 May 2019 09:48:50 +0000 (12:48 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 2 May 2019 09:48:50 +0000 (12:48 +0300)
rc.d/uploader [new file with mode: 0755]

diff --git a/rc.d/uploader b/rc.d/uploader
new file mode 100755 (executable)
index 0000000..f30fba6
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: uploader
+# REQUIRE: DAEMON NETWORKING FILESYSTEMS
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# uploader_enable (bool):      Set to NO by default.
+#                              Set it to YES to enable uploader.
+# uploader_chdir (path):       Set to /storage/gw/incoming by default.
+# uploader_bind (string):      Address:port to bind to
+#                              Default is "[::]:8086".
+
+. /etc/rc.subr
+
+name=uploader
+rcvar=uploader_enable
+
+load_rc_config $name
+
+: ${uploader_enable:="NO"}
+: ${uploader_chdir="/storage/gw/incoming"}
+: ${uploader_bind="[::]:8086"}
+
+command=/home/stargrave/uploader
+command_args="-bind '$uploader_bind' >> log 2>&1 &"
+command_chdir=$uploader_chdir
+uploader_user=stargrave
+
+run_rc_command "$1"