diff --git a/ucc-image-toolkit/ucc-image-set-join-information b/ucc-image-toolkit/ucc-image-set-join-information index 3c11c69..4a2a5a4 100755 --- a/ucc-image-toolkit/ucc-image-set-join-information +++ b/ucc-image-toolkit/ucc-image-set-join-information @@ -69,9 +69,10 @@ usage () { IMAGE="" ASK_USERNAME=true ASK_DOMAIN=true +ASK_PASSWORD=true # options -while getopts 'i:u:d:h' OPTION; do +while getopts 'i:u:d:p:h' OPTION; do case "$OPTION" in i) IMAGE="$OPTARG" @@ -84,6 +85,10 @@ while getopts 'i:u:d:h' OPTION; do ASK_DOMAIN=false domain="$OPTARG" ;; + p) + ASK_PASSWORD=false + password="$OPTARG" + ;; h) usage @@ -130,14 +135,16 @@ if [ -z "$username" ]; then exit 1 fi -# ask for password -read -s -p "Password:" password -echo "" -read -s -p "Verify password:" passwordV2 -echo "" -if [ ! "$password" = "$passwordV2" ]; then - echo "Sorry, passwords do not match." | STDERR - exit 1 +if $ASK_PASSWORD; then + # ask for password + read -s -p "Password:" password + echo "" + read -s -p "Verify password:" passwordV2 + echo "" + if [ ! "$password" = "$passwordV2" ]; then + echo "Sorry, passwords do not match." | STDERR + exit 1 + fi fi if [ -z "$password" ]; then