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