mirror of
https://github.com/bol-van/zapret.git
synced 2025-02-22 13:02:20 +03:00
Compare commits
No commits in common. "fd4dc893609d29c14e4e8eb1229cb00b6b46a964" and "029e4cadd7be4578a67a69ac90ece83a9f25ef75" have entirely different histories.
fd4dc89360
...
029e4cadd7
@ -193,28 +193,8 @@ mdig_resolve()
|
|||||||
# $1 - ip version 4/6
|
# $1 - ip version 4/6
|
||||||
# $2 - hostname
|
# $2 - hostname
|
||||||
|
|
||||||
local hostvar=$(echo $2 | sed -e 's/[\.-]/_/g')
|
# windows version of mdig outputs 0D0A line ending. remove 0D.
|
||||||
local cachevar=DNSCACHE_${hostvar}_$1
|
echo "$2" | "$MDIG" --family=$1 | head -n 1 | tr -d '\r'
|
||||||
local countvar=${cachevar}_COUNT
|
|
||||||
local count n ip ips
|
|
||||||
eval count=\$${countvar}
|
|
||||||
if [ -n "$count" ]; then
|
|
||||||
n=$(random 0 $(($count-1)))
|
|
||||||
eval ip=\$${cachevar}_$n
|
|
||||||
echo $ip
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
# windows version of mdig outputs 0D0A line ending. remove 0D.
|
|
||||||
ips="$(echo $2 | "$MDIG" --family=$1 | tr -d '\r' | xargs)"
|
|
||||||
[ -n "$ips" ] || return 1
|
|
||||||
count=0
|
|
||||||
for ip in $ips; do
|
|
||||||
eval ${cachevar}_$count=$ip
|
|
||||||
count=$(($count+1))
|
|
||||||
done
|
|
||||||
eval $countvar=$count
|
|
||||||
mdig_resolve "$@"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_system()
|
check_system()
|
||||||
|
@ -275,18 +275,10 @@ replace_char()
|
|||||||
echo "$@" | tr $a $b
|
echo "$@" | tr $a $b
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_md5()
|
|
||||||
{
|
|
||||||
[ -n "$MD5" ] && return
|
|
||||||
MD5=md5sum
|
|
||||||
exists $MD5 || MD5=md5
|
|
||||||
}
|
|
||||||
|
|
||||||
random()
|
random()
|
||||||
{
|
{
|
||||||
# $1 - min, $2 - max
|
# $1 - min, $2 - max
|
||||||
local r rs
|
local r rs
|
||||||
setup_md5
|
|
||||||
if [ -c /dev/urandom ]; then
|
if [ -c /dev/urandom ]; then
|
||||||
read rs </dev/urandom
|
read rs </dev/urandom
|
||||||
else
|
else
|
||||||
|
@ -24,6 +24,9 @@ GET_LIST="$IPSET_DIR/get_config.sh"
|
|||||||
|
|
||||||
[ -n "$TPPORT" ] || TPPORT=988
|
[ -n "$TPPORT" ] || TPPORT=988
|
||||||
|
|
||||||
|
MD5=md5sum
|
||||||
|
exists $MD5 || MD5=md5
|
||||||
|
|
||||||
check_readonly_system()
|
check_readonly_system()
|
||||||
{
|
{
|
||||||
local RO
|
local RO
|
||||||
|
@ -36,9 +36,8 @@ static size_t tls_pos(enum tlspos tpos_type, size_t tpos_pos, const uint8_t *tls
|
|||||||
// fall through
|
// fall through
|
||||||
case tlspos_pos:
|
case tlspos_pos:
|
||||||
return tpos_pos;
|
return tpos_pos;
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user