From 9611e4ff9acc4a7bac3ef1c3f5239b9f260f6904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?= Date: Thu, 20 Feb 2025 09:30:11 +0100 Subject: [PATCH] Support more configuration in the `.proxmox` file --- deployment/proxmox/provision.sh | 41 +++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/deployment/proxmox/provision.sh b/deployment/proxmox/provision.sh index dba60b37..74b92717 100755 --- a/deployment/proxmox/provision.sh +++ b/deployment/proxmox/provision.sh @@ -28,24 +28,27 @@ debug=false help () { cat <&2 '\033[37m'; printf >&2 "$@"; printf >&2 '\033[0m\n'; fi } +if [ -f .proxmox ]; then + . "$PWD"/.proxmox +fi + while [ $# -gt 0 ]; do argument=$1 shift @@ -78,12 +85,12 @@ while [ $# -gt 0 ]; do esac done +if [ -z "$vm_ids" ]; then + die_with_help "Required: at least one VM id.\n" +fi + if [ -z "$username" ] || [ -z "$password" ]; then - if [ -f .proxmox ]; then - { read -r username; read -r password; } < .proxmox - else - die_with_help "Required: '--username' and '--password'.\n" - fi + die_with_help "Required: '--username' and '--password'.\n" fi readonly sockets