Image creation interactive mode
This commit is contained in:
parent
cad6c92681
commit
bbac58020a
Binary file not shown.
|
@ -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)"
|
||||
|
|
Loading…
Reference in New Issue