From 73dba7860aac9a8a621cdfe9e6cc23a638498733 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 18 Jan 2015 10:57:52 +0000 Subject: [PATCH] Fix system type --- src/freedombone | 58 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/src/freedombone b/src/freedombone index 3f7e79a4..c89deb29 100755 --- a/src/freedombone +++ b/src/freedombone @@ -377,9 +377,16 @@ function show_help { exit 0 } +function interactive_configuration_remote_backups { + # TODO + exit 0 +} + function interactive_configuration { + data=$(tempfile 2>/dev/null) + trap "rm -f $data" 0 1 2 5 15 dialog --backtitle "Freedombone Configuration" \ - --radiolist "Type of Installation:" 15 40 10 \ + --radiolist "Type of Installation:" 15 40 9 \ 1 Full on \ 2 Writer off \ 3 Cloud off \ @@ -388,10 +395,13 @@ function interactive_configuration { 6 Non-Mailbox off \ 7 Social off \ 8 Media off \ - 9 Tor-Dongle off + 9 Tor-Dongle off 2> $data sel=$? case $sel in - 1) ;; + 1) exit 0;; + 255) exit 0;; + esac + case $(cat $data) in 2) SYSTEM_TYPE=$VARIANT_WRITER;; 3) SYSTEM_TYPE=$VARIANT_CLOUD;; 4) SYSTEM_TYPE=$VARIANT_CHAT;; @@ -400,8 +410,23 @@ function interactive_configuration { 7) SYSTEM_TYPE=$VARIANT_SOCIAL;; 8) SYSTEM_TYPE=$VARIANT_MEDIA;; 9) SYSTEM_TYPE=$VARIANT_TOR_DONGLE;; + esac + + data=$(tempfile 2>/dev/null) + 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 + sel=$? + case $sel in + 0) MY_USERNAME=$(cat $data | awk -F '/' '{print $3}');; + 1) exit 0;; 255) exit 0;; esac + if [ ! $MY_USERNAME ]; then + echo 'No user account was selected' + exit 0 + fi dialog --title "Install Target" \ --backtitle "Freedombone Configuration" \ @@ -493,18 +518,6 @@ function interactive_configuration { exit 3784 fi - dialog --backtitle "Freedombone Configuration" \ - --inputbox "Your email address" 10 30 2> $data - sel=$? - case $sel in - 0) MY_EMAIL_ADDRESS=$(cat $data);; - 1) exit 0;; - 255) exit 0;; - esac - if [ ! $MY_EMAIL_ADDRESS ]; then - exit 8357 - fi - dialog --backtitle "Freedombone Configuration" \ --inputbox "Static IP Address of this system" 10 30 2> $data sel=$? @@ -746,7 +759,20 @@ function interactive_configuration { fi fi fi - clear + + dialog --backtitle "Freedombone Configuration" \ + --inputbox "Your email address" 10 30 $MY_USERNAME@$DOMAIN_NAME> $data + sel=$? + case $sel in + 0) MY_EMAIL_ADDRESS=$(cat $data);; + 1) exit 0;; + 255) exit 0;; + esac + if [ ! $MY_EMAIL_ADDRESS ]; then + exit 8357 + fi + + #clear exit 0 }