From e544d2d41a1d8862c175173f919b1a881745a7f4 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:42:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E6=9F=A5=E5=AF=BBi?= =?UTF-8?q?p=E5=8F=98=E5=8A=A8=E5=B9=B6=E5=8F=91=E9=80=81=E9=82=AE?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/send_email.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 shell/send_email.sh diff --git a/shell/send_email.sh b/shell/send_email.sh new file mode 100755 index 0000000..a7de937 --- /dev/null +++ b/shell/send_email.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +touch /var/local/mail.log + +currentIP=$(curl -s -4 whatismyip.akamai.com) +historyIP=$(cat /var/local/mail.log) +if [[ ${currentIP} = ${historyIP} ]];then + echo '不发送邮件' + echo '不发送邮件' >> /tmp/mail.log + exit +fi +echo ${currentIP}|mail -s ${currentIP} xxx@163.com +echo ${currentIP} > /var/local/mail.log