Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2021 20:53:39 GMT
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: c9f9ae1515c7 - 2021Q2 - www/adguardhome: Add rc script and pkg-message
Message-ID:  <202104252053.13PKrdIc011523@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q2 has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c9f9ae1515c756aaf915ba11db82b77b224c2fea

commit c9f9ae1515c756aaf915ba11db82b77b224c2fea
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2021-04-25 20:51:02 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2021-04-25 20:53:36 +0000

    www/adguardhome: Add rc script and pkg-message
    
    (cherry picked from commit c70aa54be27431b2e6b0adca99b3f733d2cf9200)
---
 www/adguardhome/Makefile             |  6 +++++-
 www/adguardhome/files/adguardhome.in | 25 +++++++++++++++++++++++++
 www/adguardhome/pkg-message          | 11 +++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/www/adguardhome/Makefile b/www/adguardhome/Makefile
index 3c8cd2da87f2..12a5bb45c616 100644
--- a/www/adguardhome/Makefile
+++ b/www/adguardhome/Makefile
@@ -2,7 +2,7 @@
 PORTNAME=	adguardhome
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.105.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -24,6 +24,10 @@ GO_MODULE=	github.com/AdguardTeam/AdGuardHome
 
 DEV_UPDATE_MODE=	no
 
+USER=		root # it has to run as root because it listens on the privileged DNS port
+SUB_LIST=	USER=${USER}
+USE_RC_SUBR=	${PORTNAME}
+
 .if (${DEV_UPDATE_MODE} == "yes")
 BUILD_DEPENDS=	npm:www/npm \
 		yarn:www/yarn
diff --git a/www/adguardhome/files/adguardhome.in b/www/adguardhome/files/adguardhome.in
new file mode 100644
index 000000000000..902745da6a35
--- /dev/null
+++ b/www/adguardhome/files/adguardhome.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# PROVIDE: adguardhome
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable adguardhome:
+# adguardhome_enable : set to "YES" to enable the daemon, default is "NO"
+
+. /etc/rc.subr
+
+name=adguardhome
+rcvar=adguardhome_enable
+
+load_rc_config $name
+
+adguardhome_enable=${adguardhome_enable:-"NO"}
+
+logfile="/var/log/${name}.log"
+
+procname=%%PREFIX%%/bin/adguardhome
+command="/usr/sbin/daemon"
+command_args="-u %%USER%% -o ${logfile} -t ${name} %%PREFIX%%/bin/adguardhome"
+
+run_rc_command "$1"
diff --git a/www/adguardhome/pkg-message b/www/adguardhome/pkg-message
new file mode 100644
index 000000000000..1a789dcbcb7b
--- /dev/null
+++ b/www/adguardhome/pkg-message
@@ -0,0 +1,11 @@
+[
+{ type: install
+  message: <<EOM
+You installed AdGuardHome: Network-wide ads & trackers blocking DNS server.
+
+In order to use it please start the service 'adguardhome' and
+then access the URL http://0.0.0.0:3010/ in your favorite browser.
+
+EOM
+}
+]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104252053.13PKrdIc011523>