2018-07-09 18:50:40 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cd directory || exit 1
|
|
|
|
|
|
|
|
tor_curl() {
|
|
|
|
curl -x socks5h://127.0.0.1:9150/ "$@"
|
|
|
|
return $?
|
|
|
|
}
|
|
|
|
|
2018-07-09 19:42:23 -04:00
|
|
|
check_onion() {
|
|
|
|
is_up=true
|
2018-07-10 05:07:05 -04:00
|
|
|
|
|
|
|
for prefix in check-status check-date ; do
|
|
|
|
test -f $prefix-3 && mv $prefix-3 $prefix-4
|
|
|
|
test -f $prefix-2 && mv $prefix-2 $prefix-3
|
|
|
|
test -f $prefix-1 && mv $prefix-1 $prefix-2
|
|
|
|
test -f $prefix && mv $prefix $prefix-1
|
|
|
|
done
|
|
|
|
|
2018-07-09 18:50:40 -04:00
|
|
|
for url in `awk '{print $1}' < urls` ; do
|
|
|
|
if tor_curl $url >curl.out~ 2>curl.err~ ; then
|
|
|
|
echo ":thumbsup:"
|
|
|
|
else
|
2018-07-09 19:42:23 -04:00
|
|
|
is_up=false # one bad apple
|
2018-07-09 18:50:40 -04:00
|
|
|
echo ":sos:"
|
|
|
|
fi
|
|
|
|
done >check-status
|
2018-07-10 05:07:05 -04:00
|
|
|
|
|
|
|
date -u "+%Y-%m-%dT%H:%M:%SZ" >check-date
|
2018-07-09 18:50:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
for category in * ; do
|
|
|
|
echo ":::: $category ::::"
|
|
|
|
cd $category || exit 1
|
|
|
|
for onion in * ; do
|
|
|
|
echo "---- $onion ----"
|
|
|
|
cd $onion || exit 1
|
2018-07-09 19:42:23 -04:00
|
|
|
check_onion
|
2018-07-09 18:50:40 -04:00
|
|
|
cd ..
|
|
|
|
done
|
|
|
|
cd ..
|
|
|
|
done
|
2018-07-10 03:46:55 -04:00
|
|
|
|
|
|
|
date -u "+%Y-%m-%dT%H:%M:%SZ" >.check-date
|