diff --git a/man/freedombone-image.1.gz b/man/freedombone-image.1.gz index 29d4ccd7..eb51e442 100644 Binary files a/man/freedombone-image.1.gz and b/man/freedombone-image.1.gz differ diff --git a/src/freedombone-image b/src/freedombone-image index 06271e45..4b08a891 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -61,6 +61,9 @@ MINIMUM_PASSWORD_LENGTH=10 # Optional ssh public key to allow SSH_PUBKEY="no" +# interactive mode +INTERACTIVE="no" + while [[ $# > 1 ]] do key="$1" @@ -122,6 +125,10 @@ case $key in shift NAMESERVER2="$1" ;; + -i|--interactive) + shift + INTERACTIVE="$1" + ;; *) # unknown option ;; @@ -129,6 +136,14 @@ esac shift done +if [[ $INTERACTIVE == "yes" || $INTERACTIVE == "y" || $INTERACTIVE == "Yes" ]]; then + freedombone-config + if [ -f freedombone.cfg ]; then + CONFIG_FILENAME=freedombone.cfg + DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}') + fi +fi + if [ ! $PASSWORD ]; then # generate a random password PASSWORD="$(openssl rand -base64 10 | cut -c1-8)" @@ -177,7 +192,7 @@ make $IMAGE_TYPE \ PROJECT_NAME="$PROJECT_NAME" \ CONFIG_FILENAME="$CONFIG_FILENAME" \ IMAGE_SIZE="$IMAGE_SIZE" \ - SSH_PUBKEY="$SSH_PUBKEY" + SSH_PUBKEY="$SSH_PUBKEY" shopt -s nullglob imgfiles=(build/${PROJECT_NAME}*.img)