add thanx to notify.pl
This commit is contained in:
parent
35bfa8a28d
commit
b46b875a84
|
@ -24,6 +24,7 @@ use warnings;
|
||||||
use autodie;
|
use autodie;
|
||||||
use POSIX qw(strftime);
|
use POSIX qw(strftime);
|
||||||
use HTTP::Tiny;
|
use HTTP::Tiny;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
# get function and function_variable (vmid) from arguments
|
# get function and function_variable (vmid) from arguments
|
||||||
my $function = $ARGV[0] || "empty";
|
my $function = $ARGV[0] || "empty";
|
||||||
|
@ -161,7 +162,7 @@ my @files = glob "$conf{'conf'}{'VMS'}/*.txt";
|
||||||
|
|
||||||
if ($function =~ /notify/) {
|
if ($function =~ /notify/) {
|
||||||
mailout(\%conf, \%vms);
|
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};
|
my %slice = %vms{$function_variable};
|
||||||
mailout(\%conf, \%slice);
|
mailout(\%conf, \%slice);
|
||||||
} elsif ($function =~ /(renewal|subscription|deprovision)/) {
|
} elsif ($function =~ /(renewal|subscription|deprovision)/) {
|
||||||
|
@ -186,5 +187,5 @@ if ($function =~ /notify/) {
|
||||||
}
|
}
|
||||||
mailout(\%conf, \%vms);
|
mailout(\%conf, \%vms);
|
||||||
} else {
|
} 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";
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,4 @@
|
||||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#
|
#
|
||||||
OPTIONS=${1:--qa}
|
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
|
||||||
|
|
Loading…
Reference in New Issue