From b46b875a8499ce8ac6968f8bc3361a836759a9a4 Mon Sep 17 00:00:00 2001 From: mischa Date: Wed, 4 Aug 2021 18:08:29 +0200 Subject: [PATCH] add thanx to notify.pl --- notify.pl | 5 +++-- sync-it.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/notify.pl b/notify.pl index fa0a8c7..ee918bc 100755 --- a/notify.pl +++ b/notify.pl @@ -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 , stopped, renewal, notify, deprovision, msg \n"; + print "usage: " . basename($0) . " [stopped | renewal | notify | deprovision] | [deployed | msg | thanx] \n"; } diff --git a/sync-it.sh b/sync-it.sh index be5e22c..a960bb3 100755 --- a/sync-it.sh +++ b/sync-it.sh @@ -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