mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 20:20:53 +03:00
blockcheck: warn if zapret processes already running
This commit is contained in:
parent
4733e1a15e
commit
32158541b1
@ -348,6 +348,26 @@ check_system()
|
||||
echo firewall type is $FWTYPE
|
||||
}
|
||||
|
||||
zp_already_running()
|
||||
{
|
||||
case "$UNAME" in
|
||||
CYGWIN)
|
||||
win_process_exists $PKTWSD
|
||||
;;
|
||||
*)
|
||||
process_exists $PKTWSD || process_exists tpws
|
||||
esac
|
||||
}
|
||||
check_already()
|
||||
{
|
||||
echo \* checking already running zapret processes
|
||||
if zp_already_running; then
|
||||
echo "!!! WARNING. some zapret processes already running !!!"
|
||||
echo "!!! WARNING. blockcheck requires all DPI bypass methods disabled !!!"
|
||||
echo "!!! WARNING. pls stop all zapret instances that may interfere with blockcheck !!!"
|
||||
fi
|
||||
}
|
||||
|
||||
freebsd_module_loaded()
|
||||
{
|
||||
# $1 - module name
|
||||
@ -1796,6 +1816,7 @@ sigsilent()
|
||||
fsleep_setup
|
||||
fix_sbin_path
|
||||
check_system
|
||||
check_already
|
||||
[ "$UNAME" = CYGWIN ] || require_root
|
||||
check_prerequisites
|
||||
trap sigint_cleanup INT
|
||||
|
@ -313,6 +313,22 @@ shell_name()
|
||||
}
|
||||
}
|
||||
|
||||
process_exists()
|
||||
{
|
||||
if exists pgrep; then
|
||||
pgrep ^$1$ >/dev/null
|
||||
elif exists pidof; then
|
||||
pidof $1 >/dev/null
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
win_process_exists()
|
||||
{
|
||||
tasklist /NH /FI "IMAGENAME eq ${1}.exe" | grep -q "^${1}.exe"
|
||||
}
|
||||
|
||||
std_ports()
|
||||
{
|
||||
HTTP_PORTS=${HTTP_PORTS:-80}
|
||||
|
Loading…
Reference in New Issue
Block a user