Skip to content

Commit

Permalink
New function send_mail() to automate notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Tronde committed Jan 4, 2018
1 parent 55408e7 commit 92aac66
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion create_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ADVISORIES='/data/jka_dev/rhel-patchmanagement/new_advisories.txt'
CURRENT_PATCH_SET="/data/jka_dev/rhel-patchmanagement/patch_set_`date +%Y-%m-%d.txt`"
VARS='/data/jka_dev/rhel-patchmanagement/vars/main.yml'
MAIL_TEXT='/data/jka_dev/rhel-patchmanagement/mail_text.txt'
MAIL_RCP='[email protected]'
DATE1="`date --iso -d '+7 days'`T04:20"
DATE2="`date --iso -d '+14 days'`T04:20"
DATE3="`date --iso -d '+21 days'`T04:20"
Expand Down Expand Up @@ -58,7 +59,7 @@ EOF
create_mail() {
cat >"${MAIL_TEXT}" <<EOF
Hallo,
zu den unten folgenden Stichtagen erfolgt die zentral gesteuerte Installation der Red Hat Advisories.
zu den unten genannten Stichtagen erfolgt die zentral gesteuerte Installation der Red Hat Advisories.
Es gelten folgende Stichtage fuer die Installation:
Expand All @@ -79,7 +80,12 @@ Sollte die Installation der genannten Advisories erforderlich sein, werden die b
EOF
}

send_mail() {
/usr/bin/mailx -s 'Ankündigung der Installation von Red Hat Advisories' "${MAIL_RCP}" <"${MAIL_TEXT}"
}

# Main #######################################################################
create_patch_set
create_vars
create_mail
send_mail

0 comments on commit 92aac66

Please sign in to comment.