0
0
mirror of https://github.com/bol-van/zapret.git synced 2025-07-09 23:35:05 +00:00

install_easy: run daemon test under proper user

This commit is contained in:
bol-van 2025-05-29 18:59:24 +03:00
parent fd698d801b
commit 468d293b46
2 changed files with 19 additions and 13 deletions

View File

@ -187,7 +187,7 @@ check_system()
SYSTEM= SYSTEM=
SUBSYS= SUBSYS=
SYSTEMCTL=$(whichq systemctl) SYSTEMCTL="$(whichq systemctl)"
get_fwtype get_fwtype
OPENWRT_FW3= OPENWRT_FW3=
@ -203,6 +203,7 @@ check_system()
# some distros include systemctl without systemd # some distros include systemctl without systemd
if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then
SYSTEM=systemd SYSTEM=systemd
[ -f "$EXEDIR/init.d/sysv/functions" ] && . "$EXEDIR/init.d/sysv/functions"
elif [ -f "/etc/openwrt_release" ] && exists opkg || exists apk && exists uci && [ "$INIT" = "procd" ] ; then elif [ -f "/etc/openwrt_release" ] && exists opkg || exists apk && exists uci && [ "$INIT" = "procd" ] ; then
SYSTEM=openwrt SYSTEM=openwrt
OPENWRT_PACKAGER=opkg OPENWRT_PACKAGER=opkg
@ -226,8 +227,10 @@ check_system()
OPENWRT_FW4=1 OPENWRT_FW4=1
info="${info}firewall fw4. flow offloading requires nftables." info="${info}firewall fw4. flow offloading requires nftables."
fi fi
[ -f "$EXEDIR/init.d/openwrt/functions" ] && . "$EXEDIR/init.d/openwrt/functions"
elif openrc_test; then elif openrc_test; then
SYSTEM=openrc SYSTEM=openrc
[ -f "$EXEDIR/init.d/sysv/functions" ] && . "$EXEDIR/init.d/sysv/functions"
else else
echo system is not either systemd, openrc or openwrt based echo system is not either systemd, openrc or openwrt based
echo easy installer can set up config settings but can\'t configure auto start echo easy installer can set up config settings but can\'t configure auto start
@ -237,10 +240,12 @@ check_system()
else else
exitp 5 exitp 5
fi fi
[ -f "$EXEDIR/init.d/sysv/functions" ] && . "$EXEDIR/init.d/sysv/functions"
fi fi
linux_get_subsys linux_get_subsys
elif [ "$UNAME" = "Darwin" ]; then elif [ "$UNAME" = "Darwin" ]; then
SYSTEM=macos SYSTEM=macos
[ -f "$EXEDIR/init.d/macos/functions" ] && . "$EXEDIR/init.d/macos/functions"
else else
echo easy installer only supports Linux and MacOS. check readme.md for supported systems and manual setup info. echo easy installer only supports Linux and MacOS. check readme.md for supported systems and manual setup info.
exitp 5 exitp 5
@ -834,13 +839,13 @@ dry_run_tpws_()
{ {
local TPWS="$ZAPRET_BASE/tpws/tpws" local TPWS="$ZAPRET_BASE/tpws/tpws"
echo verifying tpws options echo verifying tpws options
"$TPWS" --dry-run "$@" "$TPWS" --dry-run --user=$WS_USER "$@"
} }
dry_run_nfqws_() dry_run_nfqws_()
{ {
local NFQWS="$ZAPRET_BASE/nfq/nfqws" local NFQWS="$ZAPRET_BASE/nfq/nfqws"
echo verifying nfqws options echo verifying nfqws options
"$NFQWS" --dry-run "$@" "$NFQWS" --dry-run --user=$WS_USER "$@"
} }
dry_run_tpws() dry_run_tpws()
{ {

View File

@ -53,21 +53,24 @@ check_readonly_system()
check_source() check_source()
{ {
local bad=0 local bad=0
echo \* checking source files echo \* checking source files
case $SYSTEM in case $SYSTEM in
systemd) systemd)
[ -f "$EXEDIR/init.d/systemd/zapret.service" ] || bad=1 [ -f "$EXEDIR/init.d/systemd/zapret.service" ] || bad=1
;; ;;
openrc) openrc)
[ -f "$EXEDIR/init.d/openrc/zapret" ] || bad=1 [ -f "$EXEDIR/init.d/openrc/zapret" ] || bad=1
;; ;;
*) macos)
esac [ -f "$EXEDIR/init.d/macos/zapret" ] || bad=1
[ "$bad" = 1 ] && { ;;
echo 'some critical files are missing' esac
echo 'are you sure you are not using embedded release ? you need full version for traditional linux' [ "$bad" = 1 ] && {
exitp 5 echo 'some critical files are missing'
} echo 'are you sure you are not using embedded release ? you need full version for traditional linux'
exitp 5
}
} }
check_bins() check_bins()
@ -905,8 +908,6 @@ fsleep_setup
check_system check_system
check_source check_source
[ "$SYSTEM" = "macos" ] && . "$EXEDIR/init.d/macos/functions"
case $SYSTEM in case $SYSTEM in
systemd) systemd)
install_systemd install_systemd