aboutsummaryrefslogtreecommitdiff
path: root/www/gatus/files/gatus.in
diff options
context:
space:
mode:
Diffstat (limited to 'www/gatus/files/gatus.in')
-rw-r--r--www/gatus/files/gatus.in37
1 files changed, 37 insertions, 0 deletions
diff --git a/www/gatus/files/gatus.in b/www/gatus/files/gatus.in
new file mode 100644
index 000000000000..ea9cb6f136e0
--- /dev/null
+++ b/www/gatus/files/gatus.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# PROVIDE: gatus
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Configuration settings for Gatus in /etc/rc.conf
+#
+# gatus_enable (bool): Enable Gatus. (default=NO)
+# gatus_log (str): Log output. (default=/var/log/gatus.log)
+# gatus_log_level (str): Log level. (default=INFO)
+# gatus_delay_start_seconds (int): Sleep on startup. (default=0)
+# gatus_runas (str): User to run Gatus as. (default=%%USER%%)
+# gatus_config (str): Configuration file. (default=%%PREFIX%%/etc/gatus.yaml)
+
+. /etc/rc.subr
+
+name="gatus"
+desc="Automated developer-oriented status page"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${gatus_enable:="NO"}
+: ${gatus_log:="/var/log/${name}.log"}
+: ${gatus_log_level:="INFO"}
+: ${gatus_delay_start_seconds:="0"}
+: ${gatus_runas:="%%USER%%"}
+: ${gatus_config:="%%PREFIX%%/etc/${name}.yaml"}
+
+gatus_env="GATUS_CONFIG_PATH=${gatus_config} GATUS_LOG_LEVEL=${gatus_log_level} GATUS_DELAY_START_SECONDS=${gatus_delay_start_seconds}"
+pidfile="/var/run/${name}.pid"
+procname="%%LOCALBASE%%/bin/${name}"
+command="/usr/sbin/daemon"
+command_args="-c -u ${gatus_runas} -o ${gatus_log} -p ${pidfile} -t \"${desc}\" ${procname}"
+
+run_rc_command "$1"