-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·39 lines (32 loc) · 1.36 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
mSendBin=$(command -v msend)
mSysMonBin=$(command -v msysmon)
if [[ -z ${mSendBin} ]]; then
echo "Installing mSend..."
sudo curl -sL "https://github.com/harry41/mSend/raw/master/msend" -o /usr/bin/msend
sudo chmod +x /usr/bin/msend
msend -v
fi
if [[ -z ${mSysMonBin} ]]; then
echo "Installing mSysMon..."
sudo curl -sL "https://github.com/harry41/mSend/raw/master/tools/msysmon" -o /usr/bin/msysmon
sudo chmod +x /usr/bin/msysmon
fi
[ ! -f ~/.mSend/msend.conf ] || source ~/.mSend/msend.conf
if [[ ${#EMAIL_SENDER_LIST[@]} -lt '1' ]]; then
echo "Please enter your smtp Credentials (only Gmail ID valid)"
msend --get-smtp-auth
fi
# Step - 1 : Generate HTML System Report
msysmon
# Step - 2 : Send Your Generated html reports to your email
# User configs :
EMAIL_TO="[email protected]" # replace [email protected] with your email id.
if [[ ${#EMAIL_TO[@]} -gt '0' ]]; then
msend -t "$(echo ${EMAIL_TO[@]})" -s "${HOSTNAME}|$(date +%F)| System Health Report" -f /tmp/health_reports/REPORT_$(date +"%d_%b_%y")_${HOSTNAME}.html -a /var/log/auth.log
fi
# How To configure this script
# Step - 1 :- Before executing this script you need to replace my email id [[email protected]] with your email.
# Step - 2 :- You may update subject -s accordingly.
# Step - 3 :- You may attach any file using -a.
# Step - 4 :- done.