1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-30 10:38:37 +00:00

games/automuteus: Fix rc script

Reviewed by:		0mp (mentor)
Approved by:		0mp (mentor)
Differential Revision:	https://reviews.freebsd.org/D28107
This commit is contained in:
Neel Chauhan 2021-01-16 17:17:59 +00:00
parent 9df54194ce
commit b646fb75f6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=561740
2 changed files with 23 additions and 11 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= automuteus
DISTVERSION= 6.10.1
PORTREVISION= 1
CATEGORIES= games
MAINTAINER= nc@FreeBSD.org
@ -11,12 +12,6 @@ LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:modules
USE_RC_SUBR= ${PORTNAME}
SUB_FILES= pkg-message
GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME}
GO_TARGET= .:${PORTNAME}
USE_GITHUB= yes
GH_ACCOUNT= denverquane
@ -64,10 +59,21 @@ GH_TUPLE= \
stretchr:objx:v0.2.0:stretchr_objx/vendor/github.com/stretchr/objx \
stretchr:testify:v1.6.1:stretchr_testify/vendor/github.com/stretchr/testify
PLIST_FILES= bin/${PORTNAME} etc/${PORTNAME}/config.txt
USE_RC_SUBR= ${PORTNAME}
GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME}
GO_TARGET= .:${PORTNAME}
SUB_FILES= pkg-message
PLIST_FILES= bin/${PORTNAME} \
"@sample etc/${PORTNAME}/config.txt.sample" \
"@dir /var/log/automuteus" \
/var/log/${PORTNAME}/logs.txt
post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/automuteus
@${CP} ${FILESDIR}/config.txt ${STAGEDIR}${PREFIX}/etc/automuteus
@${MKDIR} ${STAGEDIR}${ETCDIR}
@${CP} ${FILESDIR}/config.txt ${STAGEDIR}${ETCDIR}/config.txt.sample
@${MKDIR} ${STAGEDIR}/var/log/${PORTNAME}
@${TOUCH} ${STAGEDIR}/var/log/${PORTNAME}/logs.txt
.include <bsd.port.mk>

View File

@ -19,11 +19,12 @@ load_rc_config $name
: ${automuteus_enable:="NO"}
: ${automuteus_conf:="%%PREFIX%%/etc/automuteus/config.txt"}
: ${automuteus_log:="/var/log/automuteus.log"}
: ${automuteus_log:="/var/log/automuteus"}
command="%%PREFIX%%/bin/automuteus"
pidfile=/var/run/${name}.pid
start_cmd="automuteus_start"
stop_cmd="automuteus_stop"
automuteus_start()
{
@ -31,9 +32,14 @@ automuteus_start()
/usr/sbin/daemon \
-p ${pidfile} \
/usr/bin/env \
"CONFIG_FILE=${automuteus_conf}" \
"CONFIG_PATH=${automuteus_conf}" \
"LOG_PATH=${automuteus_log}" \
${command}
}
automuteus_stop()
{
kill `cat ${pidfile}`
}
run_rc_command "$1"