add thanx to notify.pl

This commit is contained in:
mischa 2021-08-04 18:08:29 +02:00
parent 35bfa8a28d
commit b46b875a84
2 changed files with 4 additions and 3 deletions

View File

@ -24,6 +24,7 @@ use warnings;
use autodie;
use POSIX qw(strftime);
use HTTP::Tiny;
use File::Basename;
# get function and function_variable (vmid) from arguments
my $function = $ARGV[0] || "empty";
@ -161,7 +162,7 @@ my @files = glob "$conf{'conf'}{'VMS'}/*.txt";
if ($function =~ /notify/) {
mailout(\%conf, \%vms);
} elsif ($function =~ /(msg|deployed)/ and $function_variable !~ /empty/) {
} elsif ($function =~ /(deployed|msg|thanx)/ and $function_variable !~ /empty/) {
my %slice = %vms{$function_variable};
mailout(\%conf, \%slice);
} elsif ($function =~ /(renewal|subscription|deprovision)/) {
@ -186,5 +187,5 @@ if ($function =~ /notify/) {
}
mailout(\%conf, \%vms);
} else {
print "Specify function: deployed <vmid>, stopped, renewal, notify, deprovision, msg <vmid>\n";
print "usage: " . basename($0) . " [stopped | renewal | notify | deprovision] | [deployed | msg | thanx] <vmid>\n";
}

View File

@ -15,4 +15,4 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
OPTIONS=${1:--qa}
/usr/local/bin/rsync ${OPTIONS} /etc /home/mischa /var/nsd /var/unbound /var/www n1.high5.nl::obsdams/$(hostname -s) --del
/usr/local/bin/rsync ${OPTIONS} /etc /home/mischa /var/nsd /var/unbound /var/www n2.high5.nl::obsdams/$(hostname -s) --del