summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--network/AdGuardHome/AdGuardHome.SlackBuild2
-rw-r--r--network/AdGuardHome/AdGuardHome.info10
-rw-r--r--network/AdGuardHome/README15
-rw-r--r--network/AdGuardHome/rc.AdGuardHome46
4 files changed, 47 insertions, 26 deletions
diff --git a/network/AdGuardHome/AdGuardHome.SlackBuild b/network/AdGuardHome/AdGuardHome.SlackBuild
index f574600f57..e5f1a336cb 100644
--- a/network/AdGuardHome/AdGuardHome.SlackBuild
+++ b/network/AdGuardHome/AdGuardHome.SlackBuild
@@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=AdGuardHome
-VERSION=${VERSION:-0.107.48}
+VERSION=${VERSION:-0.107.50}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
diff --git a/network/AdGuardHome/AdGuardHome.info b/network/AdGuardHome/AdGuardHome.info
index 3088f00175..a2ac9fcaa5 100644
--- a/network/AdGuardHome/AdGuardHome.info
+++ b/network/AdGuardHome/AdGuardHome.info
@@ -1,10 +1,10 @@
PRGNAM="AdGuardHome"
-VERSION="0.107.48"
+VERSION="0.107.50"
HOMEPAGE="https://adguard.com/adguard-home.html"
-DOWNLOAD="https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.107.48/AdGuardHome_linux_386.tar.gz"
-MD5SUM="4f2d1bd8af158a5d081d6e46eefe1675"
-DOWNLOAD_x86_64="https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.107.48/AdGuardHome_linux_amd64.tar.gz"
-MD5SUM_x86_64="574115238a9334cf096ef16dc07feae4"
+DOWNLOAD="https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.107.50/AdGuardHome_linux_386.tar.gz"
+MD5SUM="93c36cf067970c972bb3e4b738765924"
+DOWNLOAD_x86_64="https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.107.50/AdGuardHome_linux_amd64.tar.gz"
+MD5SUM_x86_64="6f1c87c608dffbc1c57df3e9de1ac3de"
REQUIRES=""
MAINTAINER="Alexander Verbovetsky"
EMAIL="alik@ejik.org"
diff --git a/network/AdGuardHome/README b/network/AdGuardHome/README
index 6903da6680..9247b190c1 100644
--- a/network/AdGuardHome/README
+++ b/network/AdGuardHome/README
@@ -15,3 +15,18 @@ Key features of AdGuard Home:
* Force Safe search on search engines
* Per-client (device) configuration
* Access settings
+
+A simple init script /etc/rc.d/rc.AdGuardHome has been provided to run
+AdGuard Home as a daemon.
+
+In most cases, AdGuard Home should not be run as root. If there exists
+the user dnsproxy, the script /etc/rc.d/rc.AdGuardHome will run
+AdGuardHome as the user dnsproxy. This user can be created with:
+ groupadd -g 384 dnsproxy
+ useradd -u 384 -g 384 -s /sbin/nologin -M dnsproxy
+
+If the user dnsproxy does not exist, then the script
+/etc/rc.d/rc.AdGuardHome will run dnsproxy as root.
+
+Also, the script /etc/rc.d/rc.AdGuardHome assumes that the configuration
+file location is /etc/AdGuardHome/AdGuardHome.yaml
diff --git a/network/AdGuardHome/rc.AdGuardHome b/network/AdGuardHome/rc.AdGuardHome
index 73e09fdccb..f5f5b0d9bf 100644
--- a/network/AdGuardHome/rc.AdGuardHome
+++ b/network/AdGuardHome/rc.AdGuardHome
@@ -1,25 +1,36 @@
#!/bin/bash
# Start/stop/restart the AdGuard Home
-bin=/usr/sbin/AdGuardHome
-config=/etc/AdGuardHome.yaml
-workdir=/var/lib/AdGuardHome
-pidfile=/run/AdGuardHome.pid
+name="AdGuardHome"
+user="dnsproxy"
+workdir=/var/lib/"$name"
+pidfiles=/run/"$name"
+mkdir -p $pidfiles
+if /bin/id "$user" &>/dev/null; then
+ chown $user:$user $pidfiles
+ chown -R $user:$user $workdir
+ daemon="/usr/bin/daemon --name=$name --pidfiles=$pidfiles --user=$user"
+else
+ daemon="/usr/bin/daemon --name=$name --pidfiles=$pidfiles"
+fi
start_AdGuardHome() {
- echo "Starting AdGuard Home... "
- if [ -f $pidfile ]; then
- echo "AdGuard Home is already running with PID $(cat ${pidfile})."
- exit 0
- fi
- mkdir -p $workdir
- nohup $bin --config $config --work-dir $workdir --no-check-update \
- --pidfile $pidfile 0<&- &>/dev/null &
+if $daemon --running; then
+ echo "$name is already running"
+else
+ echo "Starting $name..."
+ $daemon -- /usr/sbin/AdGuardHome --config /etc/AdGuardHome/AdGuardHome.yaml \
+ --work-dir $workdir --no-check-update
+fi
}
stop_AdGuardHome() {
- echo "Stoppping AdGuard Home... "
- [ -f $pidfile ] && kill $(cat ${pidfile})
+if $daemon --running; then
+ echo "Stopping $name..."
+ $daemon --stop
+else
+ echo "$name is not running"
+fi
}
restart_AdGuardHome() {
@@ -29,12 +40,7 @@ restart_AdGuardHome() {
}
status_AdGuardHome() {
- if [ -f $pidfile ]; then
- echo "AdGuard Home is running with PID $(cat ${pidfile})."
- else
- echo "AdGuard Home is stopped."
- exit 1
- fi
+ $daemon --running --verbose
}
case "$1" in