usr local bin bash board end -0 curr -0 while curr -le end do echo Che

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/usr/local/bin/bash
board=$1
end=${2:-0}
curr=${3:-0}
while [ $curr -le $end ]
do
echo "Checking: $curr"
wget -q --spider -e robots=off -U "Opera/9.50 (Windows NT 5.1; U; en)" "http://2ch.ru/${board}/arch/res/${curr}.html"
if [ $? -eq 0 ]; then
echo $curr >> "${board}.log"
echo "FOUND: $curr"
fi
if [ `expr $curr % 100 ` -eq 0 ] ; then
echo "@`date`: checking ${board}:${curr}" >> archping.log
fi
curr=`expr $curr + 1`
# sleep 1
done