From c066cf03cc62b3dcd01aec352eb80e12acb31e63 Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 24 Nov 2021 13:03:42 +0300 Subject: [PATCH] install_easy: init detection incompat with openrc, DNS check replace kinozal --- install_easy.sh | 6 ++++-- uninstall_easy.sh | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/install_easy.sh b/install_easy.sh index 219d116..d348b2f 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -18,7 +18,7 @@ GET_LIST_PREFIX=/ipset/get_ INIT_SCRIPT=/etc/init.d/zapret DNSCHECK_DNS="8.8.8.8 1.1.1.1 77.88.8.8" -DNSCHECK_DOM="pornhub.com putinhuylo.com rutracker.org nnmclub.to kinozal.tv" +DNSCHECK_DOM="pornhub.com putinhuylo.com rutracker.org nnmclub.to protonmail.com" DNSCHECK_DIG1=/tmp/dig1.txt DNSCHECK_DIG2=/tmp/dig2.txt DNSCHECK_DIGS=/tmp/digs.txt @@ -207,7 +207,9 @@ check_system() local UNAME=$(uname) if [ "$UNAME" = "Linux" ]; then # do not use 'exe' because it requires root - local INIT="$(basename $(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1))" + local INIT=$(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1) + [ -L "$INIT" ] && INIT=$(readlink "$INIT") + INIT=$(basename "$INIT") # some distros include systemctl without systemd if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then SYSTEM=systemd diff --git a/uninstall_easy.sh b/uninstall_easy.sh index 5e3b6c0..018e262 100755 --- a/uninstall_easy.sh +++ b/uninstall_easy.sh @@ -54,7 +54,9 @@ check_system() local UNAME=$(uname) if [ "$UNAME" = "Linux" ]; then # do not use 'exe' because it requires root - local INIT="$(basename $(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1))" + local INIT=$(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1) + [ -L "$INIT" ] && INIT=$(readlink "$INIT") + INIT=$(basename "$INIT") # some distros include systemctl without systemd if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then SYSTEM=systemd