summaryrefslogtreecommitdiffstats
path: root/notify.pl
diff options
context:
space:
mode:
Diffstat (limited to 'notify.pl')
-rwxr-xr-xnotify.pl5
1 files changed, 3 insertions, 2 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 <vmid>, stopped, renewal, notify, deprovision, msg <vmid>\n";
+ print "usage: " . basename($0) . " [stopped | renewal | notify | deprovision] | [deployed | msg | thanx] <vmid>\n";
}