diff --git a/src/freedombone b/src/freedombone index 3dfef03a..17d5ae7c 100755 --- a/src/freedombone +++ b/src/freedombone @@ -94,6 +94,7 @@ VERSION="1.00" # Different system variants which may be specified within # the SYSTEM_TYPE option +VARIANT_FULL="full" VARIANT_WRITER="writer" VARIANT_CLOUD="cloud" VARIANT_CHAT="chat" @@ -378,8 +379,8 @@ function show_help { } function interactive_configuration_remote_backups { - # TODO - exit 0 + # TODO + exit 0 } function interactive_configuration { @@ -402,6 +403,7 @@ function interactive_configuration { 255) exit 0;; esac case $(cat $data) in + 1) SYSTEM_TYPE=$VARIANT_FULL;; 2) SYSTEM_TYPE=$VARIANT_WRITER;; 3) SYSTEM_TYPE=$VARIANT_CLOUD;; 4) SYSTEM_TYPE=$VARIANT_CHAT;; @@ -416,7 +418,7 @@ function interactive_configuration { trap "rm -f $data" 0 1 2 5 15 dialog --title "Select the user account to install as" \ --backtitle "Freedombone Configuration" \ - --dselect /home/ 14 40 2> $data + --dselect /home/ 14 40 2> $data sel=$? case $sel in 0) MY_USERNAME=$(cat $data | awk -F '/' '{print $3}');; @@ -424,8 +426,12 @@ function interactive_configuration { 255) exit 0;; esac if [ ! $MY_USERNAME ]; then - echo 'No user account was selected' - exit 0 + echo 'No user account was selected' + exit 0 + fi + if [ ! -d /home/$MY_USERNAME ]; then + echo "The directory /home/$MY_USERNAME does not exist" + exit 6437 fi dialog --title "Install Target" \ @@ -559,7 +565,7 @@ function interactive_configuration { 255) exit 0;; esac - if [[ $SYSTEM_TYPE==$VARIANT_WRITER || ! $SYSTEM_TYPE ]]; then + if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then dialog --backtitle "Freedombone Configuration" \ --inputbox "Wiki Title" 10 30 2> $data sel=$? @@ -605,7 +611,7 @@ function interactive_configuration { fi fi - if [[ $SYSTEM_TYPE==$VARIANT_WRITER || ! $SYSTEM_TYPE ]]; then + if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then dialog --backtitle "Freedombone Configuration" \ --inputbox "Blog Title" 10 30 2> $data sel=$? @@ -644,8 +650,7 @@ function interactive_configuration { fi fi - - if [[ $SYSTEM_TYPE==$VARIANT_CLOUD || ! $SYSTEM_TYPE ]]; then + if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then dialog --backtitle "Freedombone Configuration" \ --inputbox "Owncloud domain name" 10 30 2> $data sel=$? @@ -678,7 +683,7 @@ function interactive_configuration { fi fi - if [[ $SYSTEM_TYPE==$VARIANT_SOCIAL || ! $SYSTEM_TYPE ]]; then + if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then dialog --backtitle "Freedombone Configuration" \ --inputbox "RedMatrix domain name" 10 30 2> $data sel=$? @@ -711,7 +716,7 @@ function interactive_configuration { fi fi - if [[ $SYSTEM_TYPE==$VARIANT_SOCIAL || ! $SYSTEM_TYPE ]]; then + if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then dialog --backtitle "Freedombone Configuration" \ --inputbox "Microblog domain name" 10 30 2> $data sel=$? @@ -767,7 +772,7 @@ function interactive_configuration { fi dialog --backtitle "Freedombone Configuration" \ - --inputbox "Your email address" 10 30 $MY_USERNAME@$DOMAIN_NAME> $data + --inputbox "Your email address" 10 30 "$MY_USERNAME@$DOMAIN_NAME" 2> $data sel=$? case $sel in 0) MY_EMAIL_ADDRESS=$(cat $data);;