diff options
author | Santhosh Raju <fox@FreeBSD.org> | 2024-11-16 19:15:13 +0100 |
---|---|---|
committer | Santhosh Raju <fox@FreeBSD.org> | 2024-11-16 19:20:48 +0100 |
commit | b60b3ff7cad4221d55a0144542d5dd494b2bc936 (patch) | |
tree | 30eb156740724095e6462f5c236a1ca142fdc2ec /www/opengist/files/opengist.in | |
parent | russian/libreoffice: fix fetch after update LibreOffice to 24.8.3 (diff) |
www/opengist: New Port: Self-hosted Pastebin powered by Git
Self-hosted pastebin powered by Git, open-source alternative to Github Gist.
WWW: https://opengist.io/
Diffstat (limited to 'www/opengist/files/opengist.in')
-rw-r--r-- | www/opengist/files/opengist.in | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/www/opengist/files/opengist.in b/www/opengist/files/opengist.in new file mode 100644 index 000000000000..9681c7d7fd1a --- /dev/null +++ b/www/opengist/files/opengist.in @@ -0,0 +1,58 @@ +#!/bin/sh + +# PROVIDE: opengist +# REQUIRE: LOGIN NETWORKING +# KEYWORD: shutdown +# + +. /etc/rc.subr + +name=opengist +rcvar=opengist_enable + +load_rc_config $name + +: ${opengist_enable:="NO"} +: ${opengist_home:="%%WWWDIR%%"} +: ${opengist_config_file:="%%PREFIX%%/etc/${name}/config.yml"} +: ${opengist_syslog_output_enable:="NO"} +: ${opengist_syslog_output_priority:="info"} +: ${opengist_syslog_output_facility:="daemon"} + +if checkyesno opengist_syslog_output_enable; then + opengist_syslog_output_flags="-t ${name} -T ${name}" + + if [ -n "${opengist_syslog_output_priority}" ]; then + opengist_syslog_output_flags="${opengist_syslog_output_flags} -s ${opengist_syslog_output_priority}" + fi + + if [ -n "${opengist_syslog_output_facility}" ]; then + opengist_syslog_output_flags="${opengist_syslog_output_flags} -l ${opengist_syslog_output_facility}" + fi +fi + +pidfile=/var/run/opengist/${name}.pid +procname="%%PREFIX%%/bin/${name}" + +start_cmd="${name}_start" +start_precmd="${name}_precmd" + +opengist_precmd() +{ + if [ ! -f ${opengist_config_file} ] + then + echo ${opengist_config_file} missing. + return 1 + fi +} + +opengist_start() { + /usr/sbin/daemon -f ${opengist_syslog_output_flags} -p ${pidfile} \ + /usr/bin/env -i \ + "PATH=%%PREFIX%%/bin:${PATH}" \ + ${procname} -c ${opengist_config_file} +} + +cd ${opengist_home} + +run_rc_command "$1" |