From 64ec238fcba341ed76034576e8307e475862ba13 Mon Sep 17 00:00:00 2001 From: Dmitry Badovsky Date: Sun, 26 Oct 2025 09:10:43 +0000 Subject: [PATCH] Update vmcreate1.sh --- vmcreate1.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vmcreate1.sh b/vmcreate1.sh index 8466aa6..2650bd7 100644 --- a/vmcreate1.sh +++ b/vmcreate1.sh @@ -12,16 +12,18 @@ storage="syno-tigra" #path="/mnt/pve/$storage/snippets" path="./snippets" node=3 +size=50 show_help() echo 'Usage:' - echo 'vmcreate [-h][-a rule_name][-k pub_keyfile][-u][-p][-f filename]' + echo 'vmcreate [-h][-a rule_name][-k pub_keyfile][-u][-p][-d 50][-f filename]' echo 'Arguments:' echo '-h - show this help;' echo '-a - add hosts to HA affinity rules;' echo "-k - embed custom public key or create new if `pub_keyfile` not specified" echo "-u - specify user instead of default `root`" echo "-p - specify password instead of default" + echo "-d - add custom disk space (in gibibytes, integer). Default is 50." echo "-f - get IP addresses and Hostnames from `flilename`;" echo "\nIf file not specified, script will use arguments as a list of IP addresses." echo "In this case Hostname will be inherited from 2 last IP octets. Example for 10.10.35.20: `vm035020`." @@ -37,10 +39,11 @@ while getopts "a:f:h" opt; do k) pubkey="$OPTARG";; u) username="$OPTARG";; p) password="$OPTARG";; + d) size="$OPTARG"; ;; # *) noopts=true esac done - +if [[ size >= 10 && size <= 500 ]]; then echo "Disk size increment shoud be in range of 10..500. Aborting." # Вывод переменных для дебага: if [[ -v file ]]; then echo "File: $file"; fi if [[ -v pubkey ]]; then echo "Public key: $pubkey"; fi