launch system: support separate and multiple hostlists

This commit is contained in:
bol-van
2022-07-27 16:35:05 +03:00
parent 895af0f629
commit 4347cce3b6
9 changed files with 95 additions and 84 deletions

View File

@@ -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"

View File

@@ -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"