More fixing of interactive install

This commit is contained in:
Bob Mottram 2015-01-18 11:18:03 +00:00
parent 3724fb8a16
commit 4d9298f483
1 changed files with 17 additions and 12 deletions

View File

@ -94,6 +94,7 @@ VERSION="1.00"
# Different system variants which may be specified within # Different system variants which may be specified within
# the SYSTEM_TYPE option # the SYSTEM_TYPE option
VARIANT_FULL="full"
VARIANT_WRITER="writer" VARIANT_WRITER="writer"
VARIANT_CLOUD="cloud" VARIANT_CLOUD="cloud"
VARIANT_CHAT="chat" VARIANT_CHAT="chat"
@ -402,6 +403,7 @@ function interactive_configuration {
255) exit 0;; 255) exit 0;;
esac esac
case $(cat $data) in case $(cat $data) in
1) SYSTEM_TYPE=$VARIANT_FULL;;
2) SYSTEM_TYPE=$VARIANT_WRITER;; 2) SYSTEM_TYPE=$VARIANT_WRITER;;
3) SYSTEM_TYPE=$VARIANT_CLOUD;; 3) SYSTEM_TYPE=$VARIANT_CLOUD;;
4) SYSTEM_TYPE=$VARIANT_CHAT;; 4) SYSTEM_TYPE=$VARIANT_CHAT;;
@ -427,6 +429,10 @@ function interactive_configuration {
echo 'No user account was selected' echo 'No user account was selected'
exit 0 exit 0
fi fi
if [ ! -d /home/$MY_USERNAME ]; then
echo "The directory /home/$MY_USERNAME does not exist"
exit 6437
fi
dialog --title "Install Target" \ dialog --title "Install Target" \
--backtitle "Freedombone Configuration" \ --backtitle "Freedombone Configuration" \
@ -559,7 +565,7 @@ function interactive_configuration {
255) exit 0;; 255) exit 0;;
esac esac
if [[ $SYSTEM_TYPE==$VARIANT_WRITER || ! $SYSTEM_TYPE ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
dialog --backtitle "Freedombone Configuration" \ dialog --backtitle "Freedombone Configuration" \
--inputbox "Wiki Title" 10 30 2> $data --inputbox "Wiki Title" 10 30 2> $data
sel=$? sel=$?
@ -605,7 +611,7 @@ function interactive_configuration {
fi fi
fi fi
if [[ $SYSTEM_TYPE==$VARIANT_WRITER || ! $SYSTEM_TYPE ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
dialog --backtitle "Freedombone Configuration" \ dialog --backtitle "Freedombone Configuration" \
--inputbox "Blog Title" 10 30 2> $data --inputbox "Blog Title" 10 30 2> $data
sel=$? sel=$?
@ -644,8 +650,7 @@ function interactive_configuration {
fi fi
fi fi
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
if [[ $SYSTEM_TYPE==$VARIANT_CLOUD || ! $SYSTEM_TYPE ]]; then
dialog --backtitle "Freedombone Configuration" \ dialog --backtitle "Freedombone Configuration" \
--inputbox "Owncloud domain name" 10 30 2> $data --inputbox "Owncloud domain name" 10 30 2> $data
sel=$? sel=$?
@ -678,7 +683,7 @@ function interactive_configuration {
fi fi
fi fi
if [[ $SYSTEM_TYPE==$VARIANT_SOCIAL || ! $SYSTEM_TYPE ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
dialog --backtitle "Freedombone Configuration" \ dialog --backtitle "Freedombone Configuration" \
--inputbox "RedMatrix domain name" 10 30 2> $data --inputbox "RedMatrix domain name" 10 30 2> $data
sel=$? sel=$?
@ -711,7 +716,7 @@ function interactive_configuration {
fi fi
fi fi
if [[ $SYSTEM_TYPE==$VARIANT_SOCIAL || ! $SYSTEM_TYPE ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
dialog --backtitle "Freedombone Configuration" \ dialog --backtitle "Freedombone Configuration" \
--inputbox "Microblog domain name" 10 30 2> $data --inputbox "Microblog domain name" 10 30 2> $data
sel=$? sel=$?
@ -767,7 +772,7 @@ function interactive_configuration {
fi fi
dialog --backtitle "Freedombone Configuration" \ 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=$? sel=$?
case $sel in case $sel in
0) MY_EMAIL_ADDRESS=$(cat $data);; 0) MY_EMAIL_ADDRESS=$(cat $data);;