可以发邮件,播放音乐,发短信的shell脚本 推荐
2009-01-22 17:55
274 查看
因公司要求,在网站挂了之后,需要播放声音,让大家能立刻知道,假如不在公司可以发邮件给大家,假如相关人员不能上网,可以发短信给大家,达到及时通知的目的。
#!/bin/bash
#website test scripts
while true;do
for cycle_temp in `cat /opt/autotest/websit_url_links`
do
temp=1
i=1
character_sign_1=22
character_sign_2=11
while [ ${i} -lt $character_sign_1 ]
do
if lynx -dump `echo ${cycle_temp}` -accept_all_cookies|grep "true"
then
let "temp=$temp+0"
else
let "temp=$temp+1"
fi
let "i=${i}+1"
echo ${i}
echo ${temp}
sleep 5s
done
if [ ${temp} -gt $character_sign_2 ]
then
echo "${cycle_temp} has been down"
echo "${cycle_temp} has been offline,please attend it now!">/opt/autotest/test.txt
mail -s "website down mail" [email]ps_autotest@bizcom.com.cn[/email]</opt/autotest/test.txt
mplayer /opt/autotest/love.mp3
for read_phone in `cat /opt/autotest/PS_MobilePone.txt`
do
echo "sms `echo $read_phone` '`echo $cycle_temp` has been offline,please attend it now!'" >> /opt/autotest/sendmessage.txt
done
echo "exit" >>/opt/autotest/sendmessage.txt
/opt/fetion/install/fetion -u 13521186114 -p 111111 -b /opt/autotest/sendmessage.txt
fi
rm -rf /opt/autotest/sendmessage.txt
done
sleep 10m
done
需要解释的话给我发邮件[email]guoli0813@163.com[/email]。
#!/bin/bash
#website test scripts
while true;do
for cycle_temp in `cat /opt/autotest/websit_url_links`
do
temp=1
i=1
character_sign_1=22
character_sign_2=11
while [ ${i} -lt $character_sign_1 ]
do
if lynx -dump `echo ${cycle_temp}` -accept_all_cookies|grep "true"
then
let "temp=$temp+0"
else
let "temp=$temp+1"
fi
let "i=${i}+1"
echo ${i}
echo ${temp}
sleep 5s
done
if [ ${temp} -gt $character_sign_2 ]
then
echo "${cycle_temp} has been down"
echo "${cycle_temp} has been offline,please attend it now!">/opt/autotest/test.txt
mail -s "website down mail" [email]ps_autotest@bizcom.com.cn[/email]</opt/autotest/test.txt
mplayer /opt/autotest/love.mp3
for read_phone in `cat /opt/autotest/PS_MobilePone.txt`
do
echo "sms `echo $read_phone` '`echo $cycle_temp` has been offline,please attend it now!'" >> /opt/autotest/sendmessage.txt
done
echo "exit" >>/opt/autotest/sendmessage.txt
/opt/fetion/install/fetion -u 13521186114 -p 111111 -b /opt/autotest/sendmessage.txt
fi
rm -rf /opt/autotest/sendmessage.txt
done
sleep 10m
done
需要解释的话给我发邮件[email]guoli0813@163.com[/email]。
相关文章推荐
- 可以发邮件,播放音乐,发短信的shell脚本V1.2
- 可以发邮件,播放音乐,发短信的shell脚本V1.2
- Android播放器推荐:可以播放本地音乐、视频、在线播放音乐、视频、网络收音机等
- 精品软件 推荐 酷我音乐 一个可以下载320k 音质的音乐播放软件
- shell脚本中可以这样
- 利用飞信给自己发短信的shell脚本
- shell脚本操作mysql数据库,使用mysql的-e参数可以执行各种sql的(创建,删除,增,删,改、查)等各种操作
- Shc可以用来对shell脚本进行加密
- 用Intent 调用 打电话 发短信 播放音乐 删除软件 安装软件等操作
- linux下进制转换的shell脚本 推荐
- 通过脚本案例学习shell(一)如何通过复杂锁脚本解决脚本正在运行或者被意外中断问题 推荐
- shell监控MySQL主从状态脚本两则 推荐
- shell脚本:查看KVM虚拟机中的网卡信息(不需要进入启动或进入虚拟机) 推荐
- arm-linux-ld命令 ld链接脚本(不错,推荐可以学习一些lds链接脚本文件)
- MediaPlayer实现带播放条的音乐播放和视频播放,可以作为程序参考
- shell脚本操作mysql数据库,使用mysql的-e参数可以执行各种sql的(创建,删除,增,删,改、查)等各种操作
- linux监听shell脚本发邮件
- 用Shell脚本在推出的RAC节点上批量部署32个Oracle11gR2 RAC备份恢复案例场景的方法PART1 推荐
- php无法执行system()的shell脚本但是Linux终端可以执行
- shell脚本实现的网站日志分析统计(可以统计9种数据)