每天晚上自动检查更新
#!/bin/sh
#auto gamedown2 version
DATE=`/bin/date +%m%d`
COUNT=`curl 'http://11.1.1.1/index.php?m=version&c=auto&a=zheng_count'`
var=`expr $COUNT / 10`
for((i=1;i<$var;i++))
do
#sleep 5s
curl 'http://1.1.1.1/index.php?m=version&c=auto&a=version_now&page='$i
echo $i --- `/bin/date +%k:%M:%S` >> /root/shell/auto/logs/$DATE.log
done
每天零点 1 分执行
1 0 * * * /root/shell/auto/suto.sh
键盘输入范围生成plist文件
#!/bin/sh
#create plist
echo -n "Enter the number of updates required"
read COUNT
YEAR=`/bin/date +%Y`
DATE=`/bin/date +%m%d`
mkdir -p /www/inst_fengzigame/plist/$YEAR/$DATE/
chgrp www /www/inst_fengzigame/plist/$YEAR/$DATE for((i=1;i<$COUNT;i++))
do
tagid=`curl 'http://1.1.1.1/index.php?m=version&c=plist&a=get_tagid&page='$i`
content=`curl 'http://1.1.1.1/index.php?m=version&c=plist&a=create_plist&tagid='$tagid`
echo $content > /www/inst_fengzigame/plist/$YEAR/$DATE/$tagid.plist
done