From 6be5987f8d4bc64ec4365305df21903a04fc3689 Mon Sep 17 00:00:00 2001 From: mischa Date: Tue, 2 Jan 2024 12:28:47 +0100 Subject: [PATCH] push changes --- deploy.pl | 3 +++ notify.pl | 24 +++++++++++------------- startall.sh | 5 +++-- stopall.sh | 3 ++- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/deploy.pl b/deploy.pl index e9a15d1..b89e963 100755 --- a/deploy.pl +++ b/deploy.pl @@ -199,6 +199,9 @@ sub render_install_conf { chomp($jot_pass); my $_ipv4 = $vms{$vm_name}{'ipv4'} || "autoconf"; $_ipv4 = "autoconf" if $conf{'conf'}{'DHCPD'} eq "yes"; + + #my $_dhcp_ipv4 = $conf{'conf'}{'IP_PREFIX'} . "." . ($conf{'conf'}{'IP_START'} + $vms{$vm_name}{'vm_number'}) if ; + my $_ipv4_gateway = $vms{$vm_name}{'ipv4_gw'} || $conf{'conf'}{'ROUTER'}; my $_ipv6 = $vms{$vm_name}{'ipv6'} || $conf{'conf'}{'IPV6_PREFIX'} . ":" . ($conf{'conf'}{'IPV6_START'} + $vms{$vm_name}{'vm_number'}) . "::" . ($conf{'conf'}{'IP_START'} + $vms{$vm_name}{'vm_number'}); my $_ipv6_gateway = $vms{$vm_name}{'ipv6_gw'} || $conf{'conf'}{'IPV6_PREFIX'} . ":" . ($conf{'conf'}{'IPV6_START'} + $vms{$vm_name}{'vm_number'}) . "::1"; diff --git a/notify.pl b/notify.pl index a885fda..c005a38 100755 --- a/notify.pl +++ b/notify.pl @@ -19,6 +19,7 @@ # 2021/05/09 complete restructure and KISS # 2022/11/13 added price structure for notifications # 2023/05/05 variable clean up, rework IP logic +# 2023/12/03 price increase, +3 # use 5.024; use strict; @@ -34,7 +35,7 @@ my $function_variable = $ARGV[1] || "empty"; my $message = $ARGV[2] || "empty"; # define the prices for the different components of the VM -my $base_price = '64'; +my $base_price = '67'; my %memory_prices = ('2G' => '10', '4G' => '30', '8G' => '70'); my %hdd_prices = ('50G' => '50', '100G' => '100', '150G' => '150', '200G' => '200'); my $ideal_url; @@ -42,18 +43,15 @@ my $paypal_url; my %stripe_urls = ( 'sponsor' => 'SPONSORED', 'sponsored' => 'SPONSORED', - '44' => 'https://buy.stripe.com/28odR0aWK0jq0aAeV0', - '64' => 'https://buy.stripe.com/8wMaEO0i67LS1eE288', - '74' => 'https://buy.stripe.com/aEU5kuc0Ofek4qQ001', - '84' => 'https://buy.stripe.com/9AQ8wG8OCfek9LaaEI', - '94' => 'https://buy.stripe.com/3cs28i6GuaY4f5ueUZ', - '114' => 'https://buy.stripe.com/14k00ae8W2ryg9y28a', - '124' => 'https://buy.stripe.com/cN2fZ81mac28g9ydQT', - '134' => 'https://buy.stripe.com/28o4gq0i67LSe1q8wD', - '144' => 'https://buy.stripe.com/cN214ec0O1nuf5u6ow', - '184' => 'https://buy.stripe.com/9AQ8wGe8W0jq1eEdQZ', - '194' => 'https://buy.stripe.com/bIY5kugh4gioe1qeV6', - '334' => 'https://buy.stripe.com/9AQfZ80i6gio8H64gq', + '47' => 'https://buy.stripe.com/28odR0aWK0jq0aAeV0', + '67' => 'https://buy.stripe.com/8wMaEO0i67LS1eE288', + '77' => 'https://buy.stripe.com/aEU5kuc0Ofek4qQ001', + '97' => 'https://buy.stripe.com/3cs28i6GuaY4f5ueUZ', + '117' => 'https://buy.stripe.com/14k00ae8W2ryg9y28a', + '127' => 'https://buy.stripe.com/cN2fZ81mac28g9ydQT', + '147' => 'https://buy.stripe.com/cN214ec0O1nuf5u6ow', + '277' => 'https://buy.stripe.com/28o5kuaWK6HO3mMeV8', + '337' => 'https://buy.stripe.com/9AQfZ80i6gio8H64gq', ); # fuction to parse _deploy.conf and vm*.txt files diff --git a/startall.sh b/startall.sh index 5b45ab9..85238d5 100755 --- a/startall.sh +++ b/startall.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2019-2021 Mischa Peters +# Copyright (c) 2019-2023 Mischa Peters # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -14,6 +14,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +DELAY=0 SLEEP=240 CPU=$(($(sysctl -n hw.ncpuonline)-2)) @@ -29,7 +30,7 @@ echo "Starting ${#VMS[*]} VMs on ${CPU} CPUs in ${CYCLES} cycle(s), waiting ${SL COUNTER=0 for i in ${VMS[*]}; do COUNTER=$((${COUNTER}+1)) - vmctl start ${i} ; sleep 5 + vmctl start ${i} ; sleep ${DELAY} if [ $COUNTER -eq $CPU ]; then sleep ${SLEEP} COUNTER=0 diff --git a/stopall.sh b/stopall.sh index bfe52f4..4f8007c 100755 --- a/stopall.sh +++ b/stopall.sh @@ -14,6 +14,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +DELAY=0 SLEEP=30 CPU=$(($(sysctl -n hw.ncpuonline)-2)) @@ -34,7 +35,7 @@ echo "Stopping ${#VMS[*]} VMs on ${CPU} CPUs in ${CYCLES} cycle(s), waiting ${SL COUNTER=0 for i in ${VMS[*]}; do COUNTER=$((${COUNTER}+1)) - vmctl stop ${i} + vmctl stop ${i} ; sleep ${DELAY} if [ $COUNTER -eq $CPU ]; then sleep ${SLEEP} COUNTER=0