标签:发送邮件函数
#发送邮件函数function send_mail(){ #定义邮件发送列表 maillist=( zhengwei.liu@xxx xiaogang.yang@xxx sundy.she@xxx ) if [ "$1" == "gateway" ];then for mail in ${maillist[*]};do echo "无法ping通网关,请检查网络" | mail -s "PI(10.78.1.122)网络故障" $mail done elif [ "$1" == "change" ];then for mail in ${maillist[*]};do mail -s "$VIP发生切换" $mail < /tmp/VIP_qiehuan.txt done fi }
注:$1为函数的参数,不是脚本的参数
标签:发送邮件函数
原文地址:http://blog.51cto.com/liuzhengwei521/2083282