blob: 0582b18f7cbec7486e6de4e4be39e52433d4c139 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh
# (c) 2019 KatolaZ <katolaz@freaknet.org>
# MIT License
FILEIN="${1:-/dev/stdin}"
IFS=' '
while read -r D T S H P SH; do
NSH="$(printf "$S\r\n" | nc "$H" "$P" | shasum -a 256 | cut -d " " -f 1)"
[ "${SH}" != "${NSH}" ] && {
D="$(date +%Y%m%d)"
SH="${NSH}"
}
printf "%s\t%s\t%s\t%s\t%s\t%s\n" "$D" "$T" "$S" "$H" "$P" "$SH"
done < "${FILEIN}" | tee /dev/stderr | sort -rnk1 -k2 | \
sed -r "s/^([0-9][0-9]*) /1(\1) /g;s/ [a-f0-9][a-f0-9]*$//g" |\
sort -rk1 -k2
|