houbin 发表于 2018-8-25 09:12:26

shell 脚本自动配置发送qq邮件

#!/bin/bash  

  
. /etc/init.d/functions
  

  

  
if [ $# -ne 0 ];then
  
    echo "Usage: sh `basename $0`"
  
    exit 1
  
fi
  

  
frommail='147220591@qq.com'
  
smtp_host='smtp.qq.com'
  
smtp_auth_user='147220591@qq.com'
  
smpt_auth_password='mdkuasfhnjbrbhdj'
  
certs_dir=/root/.certs
  
mail_conf=/etc/mail.rc
  

  

  
content=`cat $mail_conf |grep 'smtp-auth-user'`
  
if [ "x$content" != "x"];then
  
   action"'$mail_conf' 文件已经配置" /bin/true
  
   exit 1
  
fi
  

  

  
cat >> $mail_conf
页: [1]
查看完整版本: shell 脚本自动配置发送qq邮件