mirror of
https://github.com/bol-van/zapret.git
synced 2025-05-24 22:32:58 +03:00
launch system: support separate and multiple hostlists
This commit is contained in:
@@ -21,24 +21,13 @@ curl -H "Accept-Encoding: gzip" -k --fail --max-time 600 --connect-timeout 5 --r
|
||||
exit 2
|
||||
}
|
||||
|
||||
composite_list()
|
||||
{
|
||||
# combine reestr and user list
|
||||
if [ -f "$ZUSERLIST_EXCLUDE" ]; then
|
||||
nice -n 5 $GREP -xvFf "$ZUSERLIST_EXCLUDE" "$ZDOM"
|
||||
else
|
||||
cat "$ZDOM"
|
||||
fi
|
||||
[ -f "$ZUSERLIST" ] && $AWK '{ print tolower($0) }' <"$ZUSERLIST"
|
||||
}
|
||||
|
||||
dlsize=$(LANG=C wc -c "$ZDOM" | xargs | cut -f 1 -d ' ')
|
||||
if test $dlsize -lt 102400; then
|
||||
echo list file is too small. can be bad.
|
||||
exit 2
|
||||
fi
|
||||
|
||||
composite_list | sort -u | zz "$ZHOSTLIST"
|
||||
sort -u "$ZDOM" | zz "$ZHOSTLIST"
|
||||
|
||||
rm -f "$ZDOM"
|
||||
|
||||
|
@@ -26,24 +26,13 @@ reestr_list()
|
||||
LANG=C cut -s -f2 -d';' "$ZREESTR" | LANG=C nice -n 5 sed -Ee 's/^\*\.(.+)$/\1/' -ne 's/^[a-z0-9A-Z._-]+$/&/p' | $AWK '{ print tolower($0) }'
|
||||
}
|
||||
|
||||
composite_list()
|
||||
{
|
||||
# combine reestr and user list
|
||||
if [ -f "$ZUSERLIST_EXCLUDE" ]; then
|
||||
reestr_list | nice -n 5 $GREP -xvFf "$ZUSERLIST_EXCLUDE"
|
||||
else
|
||||
reestr_list
|
||||
fi
|
||||
[ -f "$ZUSERLIST" ] && $AWK '{ print tolower($0) }' <"$ZUSERLIST"
|
||||
}
|
||||
|
||||
dlsize=$(LANG=C wc -c "$ZREESTR" | xargs | cut -f 1 -d ' ')
|
||||
if test $dlsize -lt 204800; then
|
||||
echo list file is too small. can be bad.
|
||||
exit 2
|
||||
fi
|
||||
|
||||
composite_list | sort -u | zz "$ZHOSTLIST"
|
||||
reestr_list | sort -u | zz "$ZHOSTLIST"
|
||||
|
||||
rm -f "$ZREESTR"
|
||||
|
||||
|
Reference in New Issue
Block a user