Bug fix for username in interactive installer

This commit is contained in:
Bob Mottram 2015-02-01 18:45:19 +00:00
parent 1eae495b8b
commit 3815d9a11b
1 changed files with 7 additions and 1 deletions

View File

@ -652,6 +652,7 @@ fi
function parse_args {
if [[ $NO_OF_ARGS == 0 ]]; then
echo 'no_of_args = 0'
show_help
exit 0
fi
@ -660,11 +661,13 @@ function parse_args {
echo "There is no user '$MY_USERNAME' on the system. Use 'adduser $MY_USERNAME' to create the user."
exit 1
fi
if [ ! $DOMAIN_NAME ]; then
if [ ! "$DOMAIN_NAME" ]; then
echo 'No default domain specified'
show_help
exit 2
fi
if [ ! $MY_USERNAME ]; then
echo 'No username specified'
show_help
exit 3
fi
@ -694,6 +697,9 @@ function read_configuration {
fi
if [ -f $CONFIGURATION_FILE ]; then
if grep -q "MY_USERNAME" $CONFIGURATION_FILE; then
MY_USERNAME=$(grep "MY_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "DOMAIN_NAME" $CONFIGURATION_FILE; then
DOMAIN_NAME=$(grep "DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi