list sorts

This commit is contained in:
vulpine 2020-11-04 11:45:29 -05:00
parent 2ce9ab7ccb
commit 40312fd5e9
2 changed files with 9 additions and 4 deletions

9
bl.cgi
View File

@ -11,7 +11,7 @@ Q=$(echo "$QUERY_STRING" | sed -n 's/^.*q=\([^&]*\).*$/\1/p' | sed "s/%20/ /g; s
if [[ $Q ]]
then
grep "$Q" bl.txt || echo "0 0 Not found in blacklist"
grep "$Q" bl.txt lists/* || echo "0 0 Not found in blacklist"
else
@ -21,9 +21,12 @@ cat <<EOF
# to query this, simply use a ?q=<ip> query string
#
# shoxf bl outputs data in tsv format. a typical responce would look like:
# 127.0.0.1
# bl.txt:127.0.0.1
# but there is sometimes additional info after a <tab>
#
# if any lines not starting with # are seen,
# consider it listed
#
# but it might have more stuff after the ip lol
EOF
fi

4
list
View File

@ -1,7 +1,9 @@
for fn in $(grep -rl "$1" index | cut -b 7- | rev | cut -b 5- | rev);do
echo "$fn" >> $2
echo "$fn" >> "$2"
done
sort -V "$2" > "$2.temp"
mv "$2.temp" "$2"