所有自动化脚本均是在Ubuntu 16.04 64bit环境下运行的
安装并运行:
wget xiaofd.github.io/vncam.sh
bash vncam.sh -p 'xiaofd.github.io/others/passwd-d10086' -u 'https://www.alexamaster.net/Master/103517'
在root目录下新建mon.sh脚本文件:
#!/bin/sh
echo `date`>>/root/monlog.txt
icount=`ps aux |grep firefox|grep -v grep|wc -l`
if [ $icount -lt 1 ] ;then
/sbin/reboot
fi
icount=`netstat -nautp|grep firefox|grep -v grep|wc -l`
if [ $icount -lt 3 ] ;then
killall firefox
sleep 2
su root -c 'export DISPLAY=localhost:1;firefox --profile ~/.alexa/alexa --new-tab https://www.alexamaster.net/Master/103517 &'
fi
添加crontab任务,mon.sh脚本增加执行权限
chmod +x /root/mon.sh #给予mon.sh执行权限
crontab -e
#加入以下代码
0 4 * * * /sbin/reboot
*/20 * * * * /root/mon.sh
至此就全部完成,可以愉快的挂机了
发表评论