From 8765243a3b5ac4049a4c2fc0b713c9531a687622 Mon Sep 17 00:00:00 2001 From: mischa Date: Sat, 27 Aug 2022 10:51:48 +0200 Subject: [PATCH] change NAME to FIRSTNAME, proper matching on USERNAME --- launch.sh | 2 +- notify.pl | 2 +- templates/email-cpu.txt | 2 +- templates/email-deployed.txt | 4 +++- templates/email-deprovision.txt | 2 +- templates/email-msg.txt | 2 +- templates/email-notify.txt | 2 +- templates/email-redeployed.txt | 2 +- templates/email-renewal.txt | 2 +- templates/email-stopped.txt | 2 +- templates/email-subscription.txt | 2 +- 11 files changed, 13 insertions(+), 11 deletions(-) diff --git a/launch.sh b/launch.sh index 54215b4..c497707 100755 --- a/launch.sh +++ b/launch.sh @@ -63,5 +63,5 @@ if [ $? ]; then echo echo "SUCCES! - deployed ${1}" notify.pl deployed ${1} - pushover.pl -m "$(hostname -s) ${1} deployed" + pushover.pl -m "$(hostname -s) ${1} deployed" -t "OpenBSD Amsterdam" fi diff --git a/notify.pl b/notify.pl index 7847392..6a9b9b3 100755 --- a/notify.pl +++ b/notify.pl @@ -109,7 +109,7 @@ sub mailout { printf $fh_email "To: %s\n", $_email; while (my $row = <$fh>) { chomp $row; - $row =~ s/NAME/$_firstname/g; + $row =~ s/FIRSTNAME/$_firstname/g; $row =~ s/IPV4$/$ip4address/g; $row =~ s/IPV4NETMASK$/$_ip4netmask/g; $row =~ s/IPV4GW$/$_ip4gw/g; diff --git a/templates/email-cpu.txt b/templates/email-cpu.txt index 5f3de01..6df3863 100644 --- a/templates/email-cpu.txt +++ b/templates/email-cpu.txt @@ -4,7 +4,7 @@ Subject: OpenBSD Amsterdam - maintenance Subject: OpenBSD Amsterdam VM load Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, Is your VM (VMID) on SERVER doing ok? It's consuming a load of CPU resources (80%+) which usually means something is going on. diff --git a/templates/email-deployed.txt b/templates/email-deployed.txt index 0c90471..353c2fb 100644 --- a/templates/email-deployed.txt +++ b/templates/email-deployed.txt @@ -2,7 +2,7 @@ From: admin Subject: OpenBSD Amsterdam Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, Welcome to OpenBSD Amsterdam! Your VM has been deployed. @@ -17,4 +17,6 @@ Your IPv6 address: IPV6 Your IPv6 subnet: 64 Your IPv6 gateway: IPV6GW +The username you provided was: USERNAME + Mischa diff --git a/templates/email-deprovision.txt b/templates/email-deprovision.txt index b413ce3..37239a4 100644 --- a/templates/email-deprovision.txt +++ b/templates/email-deprovision.txt @@ -2,7 +2,7 @@ From: Mischa Subject: OpenBSD Amsterdam VM will be deprovisioned Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, Your VM, VMID on SERVER, will be deprovisioned today. diff --git a/templates/email-msg.txt b/templates/email-msg.txt index e5aa4fa..35372f3 100644 --- a/templates/email-msg.txt +++ b/templates/email-msg.txt @@ -3,7 +3,7 @@ Bcc: mischa@high5.nl Subject: OpenBSD Amsterdam - maintenance Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, You have a VM (VMID) running on SERVER. We will sysupgrade SERVER from OpenBSD 6.8 to OpenBSD 6.9. diff --git a/templates/email-notify.txt b/templates/email-notify.txt index e5aa4fa..35372f3 100644 --- a/templates/email-notify.txt +++ b/templates/email-notify.txt @@ -3,7 +3,7 @@ Bcc: mischa@high5.nl Subject: OpenBSD Amsterdam - maintenance Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, You have a VM (VMID) running on SERVER. We will sysupgrade SERVER from OpenBSD 6.8 to OpenBSD 6.9. diff --git a/templates/email-redeployed.txt b/templates/email-redeployed.txt index 59a2e8a..710b28a 100644 --- a/templates/email-redeployed.txt +++ b/templates/email-redeployed.txt @@ -2,7 +2,7 @@ From: admin Subject: OpenBSD Amsterdam Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, Your VM has been re-deployed. diff --git a/templates/email-renewal.txt b/templates/email-renewal.txt index 44d51e6..cb34795 100644 --- a/templates/email-renewal.txt +++ b/templates/email-renewal.txt @@ -2,7 +2,7 @@ From: admin Subject: OpenBSD Amsterdam Renewal YEAR for VMID / SERVER Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, Your renewal fee for VMID on SERVER this year is €PAYMENT. diff --git a/templates/email-stopped.txt b/templates/email-stopped.txt index 07154f6..4e0e829 100644 --- a/templates/email-stopped.txt +++ b/templates/email-stopped.txt @@ -2,7 +2,7 @@ From: admin Subject: OpenBSD Amsterdam VM not running Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, Your VM, VMID on SERVER, is currently not running. diff --git a/templates/email-subscription.txt b/templates/email-subscription.txt index ba562d9..4755194 100644 --- a/templates/email-subscription.txt +++ b/templates/email-subscription.txt @@ -2,7 +2,7 @@ From: admin Subject: OpenBSD Amsterdam Renewal YEAR Content-Type: text/plain; charset=utf-8 -Hi NAME, +Hi FIRSTNAME, Your renewal fee for VMID on SERVER this year is €PAYMENT.