1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-17 03:25:46 +00:00
freebsd-ports/news/nzbget/files/nzbget.in
Fernando Apesteguía 059791e8b1 news/nzbget: update to 21.1
ChangeLog: https://github.com/nzbget/nzbget/releases/tag/v21.1

* Remove unused options
* Replace PYTHON option with USES flag
* Enable setting an unprivileged user in rc.conf
* Start daemon with "su -l" (allows "~" in config, fixes bug #243060)
* Fix pkg-message

PR:	256733
Reported by:	thomas@beingboiled.info
2021-06-24 19:21:21 +02:00

38 lines
743 B
Bash

#!/bin/sh
# PROVIDE: nzbget
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable the nzbget daemon:
#
# nzbget_enable="YES"
#
# Following additional settings are available:
#
# nzbget_user: user to run nzbget as (recommended)
# nzbget_conf: path to config if in a non-standard location (optional)
command=%%PREFIX%%/bin/nzbget
. /etc/rc.subr
load_rc_config nzbget
nzbget_enable=${nzbget_enable:-NO}
nzbget_user=${nzbget_user:-root}
nzbget_conf=${nzbget_conf:+"-c $nzbget_conf"}
name=nzbget
rcvar=nzbget_enable
start_cmd="nzbget_cmd -D"
stop_cmd="nzbget_cmd -Q"
reload_cmd="nzbget_cmd -O"
nzbget_cmd() {
/usr/bin/su -l $nzbget_user -c "exec $command $nzbget_conf $1"
}
run_rc_command "$1"