summaryrefslogtreecommitdiff
path: root/sysutils/go-ntfy/files/ntfy.in
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/go-ntfy/files/ntfy.in')
-rw-r--r--sysutils/go-ntfy/files/ntfy.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/sysutils/go-ntfy/files/ntfy.in b/sysutils/go-ntfy/files/ntfy.in
new file mode 100644
index 000000000000..f681ce0b5c1b
--- /dev/null
+++ b/sysutils/go-ntfy/files/ntfy.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PROVIDE: ntfy
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Configuration settings for ntfy in /etc/rc.conf
+#
+# ntfy_enable (bool): Enable ntfy. (default=NO)
+# ntfy_log (str): Log output. (default=/var/log/ntfy.log)
+# ntfy_runas (str): User to run ntfy as. (default=www)
+#
+
+. /etc/rc.subr
+
+name="ntfy"
+desc="Send push notifications to your phone or desktop using PUT/POST"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${ntfy_enable:="NO"}
+: ${ntfy_log:="/var/log/ntfy.log"}
+: ${ntfy_runas:="www"}
+: ${ntfy_args="--listen-http :8080"}
+
+pidfile="/var/run/${name}.pid"
+procname="%%LOCALBASE%%/bin/${name}"
+command="/usr/sbin/daemon"
+command_args="-c -u '${ntfy_runas}' -p '${pidfile}' -t '${desc}' -o '${ntfy_log}' '${procname}' serve ${ntfy_args}"
+
+run_rc_command "$1"