From 04638c27ada9cb3aa7679fe6bb7296c767f033ba Mon Sep 17 00:00:00 2001 From: tteckster Date: Sat, 1 Jul 2023 18:12:17 -0400 Subject: [PATCH] Update adguard-install.sh eliminate outside bash script --- install/adguard-install.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/install/adguard-install.sh b/install/adguard-install.sh index eb262cf0..ae016e90 100644 --- a/install/adguard-install.sh +++ b/install/adguard-install.sh @@ -20,9 +20,33 @@ $STD apt-get install -y mc msg_ok "Installed Dependencies" msg_info "Installing AdGuard Home" -$STD bash <(curl -fsSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh) +tar zxvf <(curl -fsSL https://static.adtidy.org/adguardhome/release/AdGuardHome_linux_amd64.tar.gz) -C /opt &>/dev/null msg_ok "Installed AdGuard Home" +msg_info "Creating Service" +cat </etc/systemd/system/AdGuardHome.service +[Unit] +Description=AdGuard Home: Network-level blocker +ConditionFileIsExecutable=/opt/AdGuardHome/AdGuardHome +After=syslog.target network-online.target + +[Service] +StartLimitInterval=5 +StartLimitBurst=10 +ExecStart=/opt/AdGuardHome/AdGuardHome "-s" "run" +WorkingDirectory=/opt/AdGuardHome +StandardOutput=file:/var/log/AdGuardHome.out +StandardError=file:/var/log/AdGuardHome.err +Restart=always +RestartSec=10 +EnvironmentFile=-/etc/sysconfig/AdGuardHome + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now AdGuardHome.service +msg_ok "Created Service" + motd_ssh customize