More interactive settings
This commit is contained in:
parent
0e6e5091ac
commit
73ec523bbb
269
src/freedombone
269
src/freedombone
|
@ -378,6 +378,31 @@ function show_help {
|
|||
}
|
||||
|
||||
function interactive_configuration {
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--radiolist "Type of Installation:" 15 40 10 \
|
||||
1 Full on \
|
||||
2 Writer off \
|
||||
3 Cloud off \
|
||||
4 Chat off \
|
||||
5 Mailbox off \
|
||||
6 Non-Mailbox off \
|
||||
7 Social off \
|
||||
8 Media off \
|
||||
9 Tor-Dongle off
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) ;;
|
||||
2) SYSTEM_TYPE=$VARIANT_WRITER;;
|
||||
3) SYSTEM_TYPE=$VARIANT_CLOUD;;
|
||||
4) SYSTEM_TYPE=$VARIANT_CHAT;;
|
||||
5) SYSTEM_TYPE=$VARIANT_MAILBOX;;
|
||||
6) SYSTEM_TYPE=$VARIANT_NONMAILBOX;;
|
||||
7) SYSTEM_TYPE=$VARIANT_SOCIAL;;
|
||||
8) SYSTEM_TYPE=$VARIANT_MEDIA;;
|
||||
9) SYSTEM_TYPE=$VARIANT_TOR_DONGLE;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
|
||||
dialog --title "Install Target" \
|
||||
--backtitle "Freedombone Configuration" \
|
||||
--defaultno \
|
||||
|
@ -390,7 +415,7 @@ function interactive_configuration {
|
|||
esac
|
||||
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--checklist "Choose Dynamic DNS provider:" 15 40 14 \
|
||||
--radiolist "Choose Dynamic DNS provider:" 15 40 14 \
|
||||
1 dyndns off \
|
||||
2 freedns on \
|
||||
3 zoneedit off \
|
||||
|
@ -480,6 +505,248 @@ function interactive_configuration {
|
|||
exit 8357
|
||||
fi
|
||||
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Static IP Address of this system" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
|
||||
exit 6950
|
||||
fi
|
||||
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "LAN IP Address of the internet router" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) ROUTER_IP_ADDRESS=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $ROUTER_IP_ADDRESS ]; then
|
||||
exit 9868
|
||||
fi
|
||||
|
||||
dialog --title "Mesh Networking" \
|
||||
--backtitle "Freedombone Configuration" \
|
||||
--defaultno \
|
||||
--yesno "\nDo you want to enable CJDNS?" 7 60
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) ENABLE_CJDNS="yes";;
|
||||
1) ENABLE_CJDNS="no";;
|
||||
255) exit 0;;
|
||||
esac
|
||||
|
||||
if [[ $SYSTEM_TYPE==$VARIANT_WRITER || ! $SYSTEM_TYPE ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Wiki Title" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) WIKI_TITLE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $WIKI_TITLE ]; then
|
||||
exit 5638
|
||||
fi
|
||||
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Wiki domain name" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) WIKI_DOMAIN_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $WIKI_DOMAIN_NAME ]; then
|
||||
exit 9236
|
||||
fi
|
||||
if [ ! $DOMAIN_NAME ]; then
|
||||
DOMAIN_NAME=$WIKI_DOMAIN_NAME
|
||||
fi
|
||||
|
||||
if [[ $DDNS_PROVIDER=="default@freedns.afraid.org" ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Wiki FreeDNS subdomain code" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) WIKI_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $WIKI_FREEDNS_SUBDOMAIN_CODE ]; then
|
||||
exit 5277
|
||||
fi
|
||||
if [[ $DOMAIN_NAME==$WIKI_DOMAIN_NAME ]]; then
|
||||
FREEDNS_SUBDOMAIN_CODE=$WIKI_FREEDNS_SUBDOMAIN_CODE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE==$VARIANT_WRITER || ! $SYSTEM_TYPE ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Blog Title" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) MY_BLOG_TITLE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
|
||||
if [ $MY_BLOG_TITLE ]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Blog domain name" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) FULLBLOG_DOMAIN_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $FULLBLOG_DOMAIN_NAME ]; then
|
||||
exit 7648
|
||||
fi
|
||||
|
||||
if [[ $DDNS_PROVIDER=="default@freedns.afraid.org" ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Blog FreeDNS subdomain code" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) FULLBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $FULLBLOG_FREEDNS_SUBDOMAIN_CODE ]; then
|
||||
exit 9875
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [[ $SYSTEM_TYPE==$VARIANT_CLOUD || ! $SYSTEM_TYPE ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Owncloud domain name" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) OWNCLOUD_DOMAIN_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
|
||||
if [ $OWNCLOUD_DOMAIN_NAME ]; then
|
||||
if [ ! $DOMAIN_NAME ]; then
|
||||
DOMAIN_NAME=$OWNCLOUD_DOMAIN_NAME
|
||||
fi
|
||||
if [[ $DDNS_PROVIDER=="default@freedns.afraid.org" ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Owncloud FreeDNS subdomain code" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) OWNCLOUD_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $OWNCLOUD_FREEDNS_SUBDOMAIN_CODE ]; then
|
||||
exit 2583
|
||||
fi
|
||||
if [[ $DOMAIN_NAME==$OWNCLOUD_DOMAIN_NAME ]]; then
|
||||
FREEDNS_SUBDOMAIN_CODE=$OWNCLOUD_FREEDNS_SUBDOMAIN_CODE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE==$VARIANT_SOCIAL || ! $SYSTEM_TYPE ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "RedMatrix domain name" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) REDMATRIX_DOMAIN_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
|
||||
if [ $REDMATRIX_DOMAIN_NAME ]; then
|
||||
if [ ! $DOMAIN_NAME ]; then
|
||||
DOMAIN_NAME=$REDMATRIX_DOMAIN_NAME
|
||||
fi
|
||||
if [[ $DDNS_PROVIDER=="default@freedns.afraid.org" ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "RedMatrix FreeDNS subdomain code" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) REDMATRIX_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $REDMATRIX_FREEDNS_SUBDOMAIN_CODE ]; then
|
||||
exit 9654
|
||||
fi
|
||||
if [[ $DOMAIN_NAME==$REDMATRIX_DOMAIN_NAME ]]; then
|
||||
FREEDNS_SUBDOMAIN_CODE=$REDMATRIX_FREEDNS_SUBDOMAIN_CODE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE==$VARIANT_SOCIAL || ! $SYSTEM_TYPE ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Microblog domain name" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) MICROBLOG_DOMAIN_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
|
||||
if [ $MICROBLOG_DOMAIN_NAME ]; then
|
||||
if [[ $DDNS_PROVIDER=="default@freedns.afraid.org" ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Microblog FreeDNS subdomain code" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) MICROBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $MICROBLOG_FREEDNS_SUBDOMAIN_CODE ]; then
|
||||
exit 9508
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! $DOMAIN_NAME ]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Domain name" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) DOMAIN_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $DOMAIN_NAME ]; then
|
||||
exit 3846
|
||||
fi
|
||||
|
||||
if [[ $DDNS_PROVIDER=="default@freedns.afraid.org" ]]; then
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "FreeDNS subdomain code" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $FREEDNS_SUBDOMAIN_CODE ]; then
|
||||
exit 7422
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
clear
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue