From ae548bb9798936b20127c5f387dbfaf64984b47a Mon Sep 17 00:00:00 2001 From: mischa Date: Thu, 9 May 2024 20:26:27 +0200 Subject: [PATCH] if vmXX.txt is passed to notify.pl strip .txt --- notify.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notify.pl b/notify.pl index c005a38..faf6136 100755 --- a/notify.pl +++ b/notify.pl @@ -34,6 +34,8 @@ my $function = $ARGV[0] || "empty"; my $function_variable = $ARGV[1] || "empty"; my $message = $ARGV[2] || "empty"; +$function_variable = substr $function_variable, 0, -4 if ($function_variable =~ m/.txt/); + # define the prices for the different components of the VM my $base_price = '67'; my %memory_prices = ('2G' => '10', '4G' => '30', '8G' => '70');