Skip to content

Commit 24cc340

Browse files
committed
remove warnings by shell check
1 parent c21b7ae commit 24cc340

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#! /bin/bash
2-
3-
# Zabbix Email alter shell script
2+
# Zabbix Email alert shell script(**Deprecated**)
43
# msmtp is an SMTP client
4+
# TODO(DingGuodong) set a configuration for msmtp
5+
# refer: https://askubuntu.com/questions/1289573/msmtp-sendmail-account-default-not-found-no-configuration-file-available-sys
6+
57
DEBUG=1
6-
if [[ ${DEBUG} -gt 0 ]];then
7-
exec 2>>/tmp/zabbix_msmtp.log
8-
set -x
8+
if [[ ${DEBUG} -gt 0 ]]; then
9+
exec 2>>/tmp/zabbix_msmtp.log
10+
set -x
911
fi
1012
FROM='example@example.com'
1113
account_name='zabbix'
@@ -17,10 +19,10 @@ recipient=$1
1719
subject=$2
1820
message=$3
1921
date=$(date --rfc-2822)
20-
sed 's/$/\r/' <<eof | /usr/bin/msmtp --account ${account_name} ${recipient}
22+
sed 's/$/\r/' <<eof | /usr/bin/msmtp --account ${account_name} "${recipient}"
2123
From: <${FROM}>
2224
To: <${recipient}>
2325
Subject: ${subject}
2426
Date: ${date}
2527
${message}
26-
eof
28+
eof

0 commit comments

Comments
 (0)