Allow for onion only interactive install

This commit is contained in:
Bob Mottram 2015-12-30 21:51:26 +00:00
parent 69945cf49d
commit 9837ceac5f
1 changed files with 362 additions and 320 deletions

View File

@ -123,6 +123,7 @@ function show_help {
echo $' -m --min Minimum password length (characters)' echo $' -m --min Minimum password length (characters)'
echo $' -w --www Freedombone web site' echo $' -w --www Freedombone web site'
echo $' -b --bm Freedombone support Bitmessage address' echo $' -b --bm Freedombone support Bitmessage address'
echo $' -o --onion [yes|no] Whether to only create .onion sites'
echo $' --minimal [yes|no] For minimalistic "consumer grade" installs' echo $' --minimal [yes|no] For minimalistic "consumer grade" installs'
echo '' echo ''
exit 0 exit 0
@ -161,6 +162,10 @@ do
shift shift
MINIMAL_INSTALL="$1" MINIMAL_INSTALL="$1"
;; ;;
-o|--onion)
shift
ONION_ONLY="$1"
;;
*) *)
# unknown option # unknown option
;; ;;
@ -1236,6 +1241,10 @@ function interactive_configuration {
fi fi
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
if [[ $ONION_ONLY != "no" ]]; then
WIKI_TITLE='My Wiki'
WIKI_DOMAIN_NAME='wiki.onion'
else
WIKI_DETAILS_COMPLETE= WIKI_DETAILS_COMPLETE=
while [ ! $WIKI_DETAILS_COMPLETE ] while [ ! $WIKI_DETAILS_COMPLETE ]
do do
@ -1285,10 +1294,15 @@ function interactive_configuration {
WIKI_DETAILS_COMPLETE="yes" WIKI_DETAILS_COMPLETE="yes"
fi fi
done done
fi
save_configuration_file save_configuration_file
fi fi
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
if [[ $ONION_ONLY != "no" ]]; then
MY_BLOG_TITLE='My Blog'
FULLBLOG_DOMAIN_NAME='blog.onion'
else
FULLBLOG_DETAILS_COMPLETE= FULLBLOG_DETAILS_COMPLETE=
while [ ! $FULLBLOG_DETAILS_COMPLETE ] while [ ! $FULLBLOG_DETAILS_COMPLETE ]
do do
@ -1340,10 +1354,14 @@ function interactive_configuration {
FULLBLOG_DETAILS_COMPLETE="yes" FULLBLOG_DETAILS_COMPLETE="yes"
fi fi
done done
fi
save_configuration_file save_configuration_file
fi fi
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
if [[ $ONION_ONLY != "no" ]]; then
OWNCLOUD_DOMAIN_NAME='owncloud.onion'
else
OWNCLOUD_DETAILS_COMPLETE= OWNCLOUD_DETAILS_COMPLETE=
while [ ! $OWNCLOUD_DETAILS_COMPLETE ] while [ ! $OWNCLOUD_DETAILS_COMPLETE ]
do do
@ -1389,10 +1407,14 @@ function interactive_configuration {
OWNCLOUD_DETAILS_COMPLETE="yes" OWNCLOUD_DETAILS_COMPLETE="yes"
fi fi
done done
fi
save_configuration_file save_configuration_file
fi fi
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
if [[ $ONION_ONLY != "no" ]]; then
HUBZILLA_DOMAIN_NAME='hubzilla.onion'
else
HUBZILLA_DETAILS_COMPLETE= HUBZILLA_DETAILS_COMPLETE=
while [ ! $HUBZILLA_DETAILS_COMPLETE ] while [ ! $HUBZILLA_DETAILS_COMPLETE ]
do do
@ -1438,10 +1460,14 @@ function interactive_configuration {
HUBZILLA_DETAILS_COMPLETE="yes" HUBZILLA_DETAILS_COMPLETE="yes"
fi fi
done done
fi
save_configuration_file save_configuration_file
fi fi
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
if [[ $ONION_ONLY != "no" ]]; then
MICROBLOG_DOMAIN_NAME='microblog.onion'
else
MICROBLOG_DETAILS_COMPLETE= MICROBLOG_DETAILS_COMPLETE=
while [ ! $MICROBLOG_DETAILS_COMPLETE ] while [ ! $MICROBLOG_DETAILS_COMPLETE ]
do do
@ -1490,10 +1516,14 @@ function interactive_configuration {
MICROBLOG_DETAILS_COMPLETE="yes" MICROBLOG_DETAILS_COMPLETE="yes"
fi fi
done done
fi
save_configuration_file save_configuration_file
fi fi
if [[ $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
if [[ $ONION_ONLY != "no" ]]; then
GIT_DOMAIN_NAME='git.onion'
else
DEVELOPER_DETAILS_COMPLETE= DEVELOPER_DETAILS_COMPLETE=
while [ ! $DEVELOPER_DETAILS_COMPLETE ] while [ ! $DEVELOPER_DETAILS_COMPLETE ]
do do
@ -1542,10 +1572,14 @@ function interactive_configuration {
DEVELOPER_DETAILS_COMPLETE="yes" DEVELOPER_DETAILS_COMPLETE="yes"
fi fi
done done
fi
save_configuration_file save_configuration_file
fi fi
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
if [[ $ONION_ONLY != "no" ]]; then
DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.onion"
else
DEFAULT_DOMAIN_DETAILS_COMPLETE= DEFAULT_DOMAIN_DETAILS_COMPLETE=
while [ ! $DEFAULT_DOMAIN_DETAILS_COMPLETE ] while [ ! $DEFAULT_DOMAIN_DETAILS_COMPLETE ]
do do
@ -1593,8 +1627,12 @@ function interactive_configuration {
fi fi
fi fi
done done
fi
save_configuration_file save_configuration_file
if [[ $ONION_ONLY != "no" ]]; then
EMAIL_ADDRESS=$MY_USERNAME@$DEFAULT_DOMAIN_NAME
else
while [ ${#MY_EMAIL_ADDRESS} -lt 5 ] while [ ${#MY_EMAIL_ADDRESS} -lt 5 ]
do do
EMAIL_ADDRESS=$(grep 'MY_EMAIL_ADDRESS' temp.cfg | awk -F '=' '{print $2}') EMAIL_ADDRESS=$(grep 'MY_EMAIL_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
@ -1616,6 +1654,7 @@ function interactive_configuration {
255) exit 1;; 255) exit 1;;
esac esac
done done
fi
save_configuration_file save_configuration_file
fi fi
@ -1768,6 +1807,9 @@ function read_configuration {
if grep -q "WIFI_CHANNEL" $CONFIGURATION_FILE; then if grep -q "WIFI_CHANNEL" $CONFIGURATION_FILE; then
WIFI_CHANNEL=$(grep "WIFI_CHANNEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') WIFI_CHANNEL=$(grep "WIFI_CHANNEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "ONION_ONLY" $CONFIGURATION_FILE; then
ONION_ONLY=$(grep "ONION_ONLY" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
fi fi
} }