From 71a93bac163f0533689d2eec85a319d9350c3546 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 1 Oct 2016 20:39:57 +0100 Subject: [PATCH] Change voip to mumble for more consistent terminology --- src/freedombone | 8 +- src/freedombone-app-mumble | 117 ++-- src/freedombone-app-sip | 46 +- src/freedombone-config | 4 +- src/freedombone-controlpanel | 24 +- src/freedombone-image-customise | 2 +- src/freedombone-mesh | 2 +- src/freedombone-utils-config | 1076 +++++++++++++++---------------- src/freedombone-utils-help | 94 +-- src/freedombone-utils-upgrade | 3 + 10 files changed, 684 insertions(+), 692 deletions(-) diff --git a/src/freedombone b/src/freedombone index 7205c7c6..f2db3ba1 100755 --- a/src/freedombone +++ b/src/freedombone @@ -192,15 +192,15 @@ else shift ENABLE_BABEL="yes" ;; - # VoIP server password + # Mumble server password --vpass) shift - VOIP_SERVER_PASSWORD=$1 + MUMBLE_SERVER_PASSWORD=$1 ;; - # VoIP server port + # Mumble server port --vport) shift - VOIP_PORT=$1 + MUMBLE_PORT=$1 ;; # DNS Nameserver 1 --ns1) diff --git a/src/freedombone-app-mumble b/src/freedombone-app-mumble index 6999e104..204f9fab 100755 --- a/src/freedombone-app-mumble +++ b/src/freedombone-app-mumble @@ -30,14 +30,14 @@ VARIANTS='full chat' -# Password used for VoIP server -VOIP_SERVER_PASSWORD= -# Port on which VoIP server listens -VOIP_PORT=64738 +# Password used for mumble server +MUMBLE_SERVER_PASSWORD= +# Port on which mumble server listens +MUMBLE_PORT=64738 -# Location of VoIP database and configuration -VOIP_DATABASE="mumble-server.sqlite" -VOIP_CONFIG_FILE="mumble-server.ini" +# Location of mumble database and configuration +MUMBLE_DATABASE="mumble-server.sqlite" +MUMBLE_CONFIG_FILE="mumble-server.ini" function install_interactive_mumble { echo -n '' @@ -58,23 +58,23 @@ function upgrade_mumble { function backup_local_mumble { if [ -f /etc/mumble-server.ini ]; then echo $"Backing up Mumble settings" - temp_backup_dir=/root/tempvoipbackup + temp_backup_dir=/root/tempmumblebackup if [ ! -d $temp_backup_dir ]; then mkdir -p $temp_backup_dir fi cp -f /etc/mumble-server.ini $temp_backup_dir cp -f /var/lib/mumble-server/mumble-server.sqlite $temp_backup_dir - backup_directory_to_usb $temp_backup_dir voip + backup_directory_to_usb $temp_backup_dir mumble echo $"Mumble settings backup complete" fi } function restore_local_mumble { - if [ -d $USB_MOUNT/backup/voip ]; then - echo $"Restoring VoIP settings" - temp_restore_dir=/root/tempvoip + if [ -d $USB_MOUNT/backup/mumble ]; then + echo $"Restoring mumble settings" + temp_restore_dir=/root/tempmumble function_check restore_directory_from_usb - restore_directory_from_usb $temp_restore_dir voip + restore_directory_from_usb $temp_restore_dir mumble cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.ini /etc/ if [ ! "$?" = "0" ]; then rm -rf $temp_restore_dir @@ -103,23 +103,23 @@ function restore_local_mumble { function backup_remote_mumble { if [ -f /etc/mumble-server.ini ]; then - echo $"Backing up VoIP settings" - if [ ! -d /root/tempvoipbackup ]; then - mkdir -p /root/tempvoipbackup + echo $"Backing up mumble settings" + if [ ! -d /root/tempmumblebackup ]; then + mkdir -p /root/tempmumblebackup fi - cp -f /etc/mumble-server.ini /root/tempvoipbackup - cp -f /var/lib/mumble-server/mumble-server.sqlite /root/tempvoipbackup - backup_directory_to_friend /root/tempvoipbackup voip - echo $"Backup of VoIP settings complete" + cp -f /etc/mumble-server.ini /root/tempmumblebackup + cp -f /var/lib/mumble-server/mumble-server.sqlite /root/tempmumblebackup + backup_directory_to_friend /root/tempmumblebackup mumble + echo $"Backup of mumble settings complete" fi } function restore_remote_mumble { - if [ -d $SERVER_DIRECTORY/backup/voip ]; then + if [ -d $SERVER_DIRECTORY/backup/mumble ]; then echo $"Restoring Mumble settings" - temp_restore_dir=/root/tempvoip + temp_restore_dir=/root/tempmumble function_check restore_directory_from_friend - restore_directory_from_friend $temp_restore_dir voip + restore_directory_from_friend $temp_restore_dir mumble cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.ini /etc/ if [ ! "$?" = "0" ]; then rm -rf $temp_restore_dir @@ -150,8 +150,8 @@ function remove_mumble { fi apt-get -y remove --purge mumble-server if [[ $ONION_ONLY == "no" ]]; then - iptables -D INPUT -p udp --dport $VOIP_PORT -j ACCEPT - iptables -D INPUT -p tcp --dport $VOIP_PORT -j ACCEPT + iptables -D INPUT -p udp --dport $MUMBLE_PORT -j ACCEPT + iptables -D INPUT -p tcp --dport $MUMBLE_PORT -j ACCEPT function_check save_firewall_settings save_firewall_settings fi @@ -159,57 +159,54 @@ function remove_mumble { rm /etc/mumble-server.ini fi function_check remove_onion_service - remove_onion_service voip ${VOIP_PORT} - sed -i '/install_mumble/d' $COMPLETION_FILE - sed -i '/install_voip/d' $COMPLETION_FILE - sed -i '/configure_firewall_for_voip/d' $COMPLETION_FILE - sed -i '/VoIP /d' $COMPLETION_FILE + remove_onion_service mumble ${MUMBLE_PORT} + sed -i '/mumble/d' $COMPLETION_FILE } -function get_voip_server_password { +function get_mumble_server_password { if [ -f /home/$MY_USERNAME/README ]; then - if grep -q "VoIP server password" /home/$MY_USERNAME/README; then - if [ ! $VOIP_SERVER_PASSWORD ]; then - VOIP_SERVER_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "VoIP server password" | awk -F ':' '{print $2}' | sed 's/^ *//') + if grep -q "mumble server password" /home/$MY_USERNAME/README; then + if [ ! $MUMBLE_SERVER_PASSWORD ]; then + MUMBLE_SERVER_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "mumble server password" | awk -F ':' '{print $2}' | sed 's/^ *//') fi else if grep -q "Mumble server password" /home/$MY_USERNAME/README; then - if [ ! $VOIP_SERVER_PASSWORD ]; then - VOIP_SERVER_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Mumble server password" | awk -F ':' '{print $2}' | sed 's/^ *//') + if [ ! $MUMBLE_SERVER_PASSWORD ]; then + MUMBLE_SERVER_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Mumble server password" | awk -F ':' '{print $2}' | sed 's/^ *//') fi fi fi fi } -function configure_firewall_for_voip { - if grep -Fxq "configure_firewall_for_voip" $COMPLETION_FILE; then +function configure_firewall_for_mumble { + if grep -Fxq "configure_firewall_for_mumble" $COMPLETION_FILE; then return fi if [[ $ONION_ONLY != "no" ]]; then return fi - iptables -A INPUT -p udp --dport $VOIP_PORT -j ACCEPT - iptables -A INPUT -p tcp --dport $VOIP_PORT -j ACCEPT + iptables -A INPUT -p udp --dport $MUMBLE_PORT -j ACCEPT + iptables -A INPUT -p tcp --dport $MUMBLE_PORT -j ACCEPT function_check save_firewall_settings save_firewall_settings - OPEN_PORTS+=("Mumble $VOIP_PORT") - echo 'configure_firewall_for_voip' >> $COMPLETION_FILE + OPEN_PORTS+=("Mumble $MUMBLE_PORT") + echo 'configure_firewall_for_mumble' >> $COMPLETION_FILE } function install_mumble { apt-get -y install mumble-server - function_check get_voip_server_password - get_voip_server_password - if [ ! $VOIP_SERVER_PASSWORD ]; then + function_check get_mumble_server_password + get_mumble_server_password + if [ ! $MUMBLE_SERVER_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - VOIP_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" + MUMBLE_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else - VOIP_SERVER_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" - if [ ${#VOIP_SERVER_PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then - VOIP_SERVER_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" + MUMBLE_SERVER_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" + if [ ${#MUMBLE_SERVER_PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then + MUMBLE_SERVER_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" fi fi fi @@ -223,11 +220,11 @@ function install_mumble { # Check that the cert was created if [ ! -f /etc/ssl/certs/mumble.crt ]; then - echo $'VoIP server certificate not created' + echo $'mumble server certificate not created' exit 57892 fi if [ ! -f /etc/ssl/private/mumble.key ]; then - echo $'VoIP server key not created' + echo $'mumble server key not created' exit 57893 fi if [ ! -d /var/lib/mumble-server ]; then @@ -237,10 +234,10 @@ function install_mumble { cp /etc/ssl/private/mumble.key /var/lib/mumble-server chown -R mumble-server:mumble-server /var/lib/mumble-server - sed -i "s|welcometext=.*|welcometext=\"
Welcome to $DEFAULT_DOMAIN_NAME VoIP.
Chat freely!
\"|g" /etc/mumble-server.ini + sed -i "s|welcometext=.*|welcometext=\"
Welcome to $DEFAULT_DOMAIN_NAME mumble.
Chat freely!
\"|g" /etc/mumble-server.ini - if [[ $VOIP_SERVER_PASSWORD && $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then - sed -i "s|serverpassword=.*|serverpassword=$VOIP_SERVER_PASSWORD|g" /etc/mumble-server.ini + if [[ $MUMBLE_SERVER_PASSWORD && $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then + sed -i "s|serverpassword=.*|serverpassword=$MUMBLE_SERVER_PASSWORD|g" /etc/mumble-server.ini fi sed -i 's|#autobanAttempts.*|autobanAttempts = 10|g' /etc/mumble-server.ini @@ -262,9 +259,9 @@ function install_mumble { sed -i 's|#imagemessagelength=.*|imagemessagelength=131072|g' /etc/mumble-server.ini sed -i 's|#allowhtml=.*|allowhtml=False|g' /etc/mumble-server.ini sed -i 's|allowhtml=.*|allowhtml=False|g' /etc/mumble-server.ini - sed -i "s|port=.*|port=${VOIP_PORT}|g" /etc/mumble-server.ini + sed -i "s|port=.*|port=${MUMBLE_PORT}|g" /etc/mumble-server.ini - VOIP_ONION_HOSTNAME=$(add_onion_service mumble ${VOIP_PORT} ${VOIP_PORT}) + MUMBLE_ONION_HOSTNAME=$(add_onion_service mumble ${MUMBLE_PORT} ${MUMBLE_PORT}) systemctl restart mumble-server @@ -273,10 +270,10 @@ function install_mumble { echo '' >> /home/$MY_USERNAME/README echo $'Mumble Server' >> /home/$MY_USERNAME/README echo '=============' >> /home/$MY_USERNAME/README - echo $"Mumble onion domain:$VOIP_ONION_HOSTNAME" >> /home/$MY_USERNAME/README + echo $"Mumble onion domain:$MUMBLE_ONION_HOSTNAME" >> /home/$MY_USERNAME/README echo $'Mumble server username: mumble-server' >> /home/$MY_USERNAME/README if [[ $SYSTEM_TYPE != "VARIANT_MESH" ]]; then - echo $"Mumble server password: $VOIP_SERVER_PASSWORD" >> /home/$MY_USERNAME/README + echo $"Mumble server password: $MUMBLE_SERVER_PASSWORD" >> /home/$MY_USERNAME/README fi echo '' >> /home/$MY_USERNAME/README echo $'To connect to the Mumble server use your username and the server password shown above.' >> /home/$MY_USERNAME/README @@ -284,8 +281,8 @@ function install_mumble { chmod 600 /home/$MY_USERNAME/README fi - function_check configure_firewall_for_voip - configure_firewall_for_voip + function_check configure_firewall_for_mumble + configure_firewall_for_mumble } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-sip b/src/freedombone-app-sip index 2ff498db..e612b88e 100755 --- a/src/freedombone-app-sip +++ b/src/freedombone-app-sip @@ -33,9 +33,9 @@ VARIANTS='full chat' SIP_SERVER_PASSWORD= SIP_PORT=5060 SIP_TLS_PORT=5061 -VOIP_TURN_PORT=3478 -VOIP_TURN_TLS_PORT=5349 -VOIP_TURN_NONCE= +TURN_PORT=3478 +TURN_TLS_PORT=5349 +TURN_NONCE= function install_interactive_sip { echo -n '' @@ -110,9 +110,9 @@ function remove_sip { if [[ $(app_is_installed sip) == "0" ]]; then return fi - iptables -D INPUT -p udp --dport $VOIP_TURN_PORT -j ACCEPT - iptables -D INPUT -p tcp --dport $VOIP_TURN_PORT -j ACCEPT - iptables -D INPUT -p tcp --dport $VOIP_TURN_TLS_PORT -j ACCEPT + iptables -D INPUT -p udp --dport $TURN_PORT -j ACCEPT + iptables -D INPUT -p tcp --dport $TURN_PORT -j ACCEPT + iptables -D INPUT -p tcp --dport $TURN_TLS_PORT -j ACCEPT iptables -D INPUT -p udp --dport $SIP_PORT -j ACCEPT iptables -D INPUT -p tcp --dport $SIP_PORT -j ACCEPT iptables -D INPUT -p udp --dport $SIP_TLS_PORT -j ACCEPT @@ -132,26 +132,26 @@ function remove_sip { rm -rf /etc/turnserver fi sed -i '/install_sip/d' $COMPLETION_FILE - sed -i '/configure_firewall_for_voip_turn/d' $COMPLETION_FILE + sed -i '/configure_firewall_for_turn/d' $COMPLETION_FILE sed -i '/configure_firewall_for_sip4/d' $COMPLETION_FILE } -function configure_firewall_for_voip_turn { - if grep -Fxq "configure_firewall_for_voip_turn" $COMPLETION_FILE; then +function configure_firewall_for_turn { + if grep -Fxq "configure_firewall_for_turn" $COMPLETION_FILE; then return fi if [[ $ONION_ONLY != "no" ]]; then return fi - iptables -A INPUT -p udp --dport $VOIP_TURN_PORT -j ACCEPT - iptables -A INPUT -p tcp --dport $VOIP_TURN_PORT -j ACCEPT - iptables -A INPUT -p tcp --dport $VOIP_TURN_TLS_PORT -j ACCEPT + iptables -A INPUT -p udp --dport $TURN_PORT -j ACCEPT + iptables -A INPUT -p tcp --dport $TURN_PORT -j ACCEPT + iptables -A INPUT -p tcp --dport $TURN_TLS_PORT -j ACCEPT function_check save_firewall_settings save_firewall_settings - OPEN_PORTS+=("TURN $VOIP_TURN_PORT") - OPEN_PORTS+=("TURN TLS $VOIP_TURN_TLS_PORT") - echo 'configure_firewall_for_voip_turn' >> $COMPLETION_FILE + OPEN_PORTS+=("TURN $TURN_PORT") + OPEN_PORTS+=("TURN TLS $TURN_TLS_PORT") + echo 'configure_firewall_for_turn' >> $COMPLETION_FILE } @@ -312,8 +312,8 @@ function install_sip_turn { apt-get -y install turnserver # create a nonce if needed - if [ ! $VOIP_TURN_NONCE ]; then - VOIP_TURN_NONCE="$(create_password 30)" + if [ ! $TURN_NONCE ]; then + TURN_NONCE="$(create_password 30)" fi function_check create_site_certificate @@ -334,13 +334,13 @@ function install_sip_turn { echo "#listen_addressv6 = { \"2001:db8::1\" }" >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf echo '## UDP listening port.' >> /etc/turnserver/turnserver.conf - echo "udp_port = $VOIP_TURN_PORT" >> /etc/turnserver/turnserver.conf + echo "udp_port = $TURN_PORT" >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf echo '## TCP listening port.' >> /etc/turnserver/turnserver.conf - echo "tcp_port = $VOIP_TURN_PORT" >> /etc/turnserver/turnserver.conf + echo "tcp_port = $TURN_PORT" >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf echo '## TLS listening port.' >> /etc/turnserver/turnserver.conf - echo "tls_port = $VOIP_TURN_TLS_PORT" >> /etc/turnserver/turnserver.conf + echo "tls_port = $TURN_TLS_PORT" >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf echo '## TLS support.' >> /etc/turnserver/turnserver.conf echo 'tls = true' >> /etc/turnserver/turnserver.conf @@ -380,7 +380,7 @@ function install_sip_turn { echo "realm = \"$DEFAULT_DOMAIN_NAME\"" >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf echo '## Nonce key.' >> /etc/turnserver/turnserver.conf - echo "nonce_key = \"$VOIP_TURN_NONCE\"" >> /etc/turnserver/turnserver.conf + echo "nonce_key = \"$TURN_NONCE\"" >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf echo '## Max relay per username.' >> /etc/turnserver/turnserver.conf echo 'max_relay_per_username = 5' >> /etc/turnserver/turnserver.conf @@ -440,8 +440,8 @@ function install_sip_turn { systemctl restart turnserver - function_check configure_firewall_for_voip_turn - configure_firewall_for_voip_turn + function_check configure_firewall_for_turn + configure_firewall_for_turn install_completed sip_turn } diff --git a/src/freedombone-config b/src/freedombone-config index 098fa3be..e2c80859 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -1928,7 +1928,7 @@ function interactive_config { if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then dialog --backtitle $"Freedombone Configuration" \ --title $"Your main domain name" \ - --form $"\nWhich domain name should your email/XMPP/IRC/VoIP be associated with?" 11 55 3 \ + --form $"\nWhich domain name should your email/XMPP/IRC/Mumble be associated with?" 11 55 3 \ $"Domain:" 1 1 "$(grep 'DEFAULT_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \ $"Code:" 2 1 "$(grep 'DEFAULT_DOMAIN_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 33 255 \ 2> $data @@ -1947,7 +1947,7 @@ function interactive_config { fi else dialog --backtitle $"Freedombone Configuration" \ - --inputbox $"Which domain name should your email/XMPP/IRC/VoIP be associated with?" 10 45 \ + --inputbox $"Which domain name should your email/XMPP/IRC/Mumble be associated with?" 10 45 \ "$(grep 'DEFAULT_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2> $data sel=$? case $sel in diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index e6f1ebb9..92009334 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -55,9 +55,9 @@ UPDATE_DATE_SCRIPT=/usr/bin/updatedate # Minimum number of characters in a password MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}') -# voip -VOIP_PORT=64738 -VOIP_ONION_PORT=8095 +# Mumble +MUMBLE_PORT=64738 +MUMBLE_ONION_PORT=8095 SSH_PORT=2222 @@ -345,18 +345,10 @@ function show_domains { if grep -q "${app_name_first_upper} domain" $COMPLETION_FILE; then app_name=${app_name_first_upper} else - if [[ ${app_name} == "mumble" ]]; then - app_name="VoIP" + if [[ ${app_name} == "searx" ]]; then + app_name="Search engine" else - if [[ ${app_name} == "gnusocial" ]]; then - app_name="GNU Social" - else - if [[ ${app_name} == "searx" ]]; then - app_name="Search engine" - else - app_name='' - fi - fi + app_name='' fi fi fi @@ -1089,7 +1081,7 @@ function restore_from_remote { 26 $"CJDNS" off \ 27 $"Email" off \ 28 $"DLNA" off \ - 29 $"VoIP" off \ + 29 $"Mumble" off \ 30 $"RSS reader" off \ 31 $"Tox" off 2> $data sel=$? @@ -1131,7 +1123,7 @@ function restore_from_remote { 26) ${PROJECT_NAME}-restore-remote $remote_domain_name cjdns;; 27) ${PROJECT_NAME}-restore-remote $remote_domain_name email;; 28) ${PROJECT_NAME}-restore-remote $remote_domain_name dlna;; - 29) ${PROJECT_NAME}-restore-remote $remote_domain_name voip;; + 29) ${PROJECT_NAME}-restore-remote $remote_domain_name mumble;; 30) ${PROJECT_NAME}-restore-remote $remote_domain_name ttrss;; 31) ${PROJECT_NAME}-restore-remote $remote_domain_name tox;; esac diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 91a9582c..7f430c87 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -817,7 +817,7 @@ if [ \$no_of_users -gt 0 ]; then echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/tox.desktop echo 'Name=Chat' >> /home/$MY_USERNAME/Desktop/tox.desktop echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/tox.desktop - echo 'Comment=Chat, VoIP and Video' >> /home/$MY_USERNAME/Desktop/tox.desktop + echo 'Comment=Chat, Voice and Video' >> /home/$MY_USERNAME/Desktop/tox.desktop echo 'Exec=bash /home/$MY_USERNAME/runtox' >> /home/$MY_USERNAME/Desktop/tox.desktop echo "Icon=/usr/share/$PROJECT_NAME/avatars/chat.png" >> /home/$MY_USERNAME/Desktop/tox.desktop echo 'StartupNotify=true' >> /home/$MY_USERNAME/Desktop/tox.desktop diff --git a/src/freedombone-mesh b/src/freedombone-mesh index 8ee9ad39..c523f63d 100755 --- a/src/freedombone-mesh +++ b/src/freedombone-mesh @@ -343,7 +343,7 @@ fi echo '' echo $'Choose communication service:' -echo $' 1. VoIP' +echo $' 1. Voice' echo $' 2. Tox Chat' echo '' diff --git a/src/freedombone-utils-config b/src/freedombone-utils-config index 7f7c8405..247c51f7 100755 --- a/src/freedombone-utils-config +++ b/src/freedombone-utils-config @@ -31,453 +31,453 @@ function read_configuration { # if not installing on a Beaglebone then use sdb as the USB drive by default if [ ! $INSTALLING_ON_BBB ]; then - if [[ $USB_DRIVE == /dev/sda1 ]]; then - USB_DRIVE=/dev/sdb1 - fi + if [[ $USB_DRIVE == /dev/sda1 ]]; then + USB_DRIVE=/dev/sdb1 + fi fi if [[ $INSTALLING_FROM_CONFIGURATION_FILE == "yes" ]]; then - if [ ! -f $CONFIGURATION_FILE ]; then - echo $"The configuration file $CONFIGURATION_FILE was not found" - exit 8935 - fi + if [ ! -f $CONFIGURATION_FILE ]; then + echo $"The configuration file $CONFIGURATION_FILE was not found" + exit 8935 + fi fi if [ -f $CONFIGURATION_FILE ]; then - read_repo_servers + read_repo_servers - # Ensure that a copy of the config exists for upgrade purposes - if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then - cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg - fi - if grep -q "REFRESH_GPG_KEYS_HOURS" $CONFIGURATION_FILE; then - REFRESH_GPG_KEYS_HOURS=$(grep "REFRESH_GPG_KEYS_HOURS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WEBMAIL_REPO" $CONFIGURATION_FILE; then - WEBMAIL_REPO=$(grep "WEBMAIL_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WEBMAIL_COMMIT" $CONFIGURATION_FILE; then - WEBMAIL_COMMIT=$(grep "WEBMAIL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIFI_INTERFACE" $CONFIGURATION_FILE; then - WIFI_INTERFACE=$(grep "WIFI_INTERFACE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIFI_SSID" $CONFIGURATION_FILE; then - WIFI_SSID=$(grep "WIFI_SSID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIFI_TYPE" $CONFIGURATION_FILE; then - WIFI_TYPE=$(grep "WIFI_TYPE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIFI_PASSPHRASE" $CONFIGURATION_FILE; then - WIFI_PASSPHRASE=$(grep "WIFI_PASSPHRASE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIFI_HOTSPOT" $CONFIGURATION_FILE; then - WIFI_HOTSPOT=$(grep "WIFI_HOTSPOT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIFI_NETWORKS_FILE" $CONFIGURATION_FILE; then - WIFI_NETWORKS_FILE=$(grep "WIFI_NETWORKS_FILE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYNCTHING_ID" $CONFIGURATION_FILE; then - SYNCTHING_ID=$(grep "SYNCTHING_ID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYNCTHING_CONFIG_PATH" $CONFIGURATION_FILE; then - SYNCTHING_CONFIG_PATH=$(grep "SYNCTHING_CONFIG_PATH" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYNCTHING_CONFIG_FILE" $CONFIGURATION_FILE; then - SYNCTHING_CONFIG_FILE=$(grep "SYNCTHING_CONFIG_FILE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYNCTHING_RELAY_SERVER" $CONFIGURATION_FILE; then - SYNCTHING_RELAY_SERVER=$(grep "SYNCTHING_RELAY_SERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYNCTHING_RELEASES" $CONFIGURATION_FILE; then - SYNCTHING_RELEASES=$(grep "SYNCTHING_RELEASES" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYNCTHING_PORT" $CONFIGURATION_FILE; then - SYNCTHING_PORT=$(grep "SYNCTHING_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYNCTHING_SHARED_DATA" $CONFIGURATION_FILE; then - SYNCTHING_SHARED_DATA=$(grep "SYNCTHING_SHARED_DATA" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "VOIP_TURN_PORT" $CONFIGURATION_FILE; then - VOIP_TURN_PORT=$(grep "VOIP_TURN_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "VOIP_TURN_TLS_PORT" $CONFIGURATION_FILE; then - VOIP_TURN_TLS_PORT=$(grep "VOIP_TURN_TLS_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "VOIP_TURN_NONCE" $CONFIGURATION_FILE; then - VOIP_TURN_NONCE=$(grep "VOIP_TURN_NONCE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DEFAULT_SEARCH" $CONFIGURATION_FILE; then - DEFAULT_SEARCH=$(grep "DEFAULT_SEARCH" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SEARCH_ENGINE_PASSWORD" $CONFIGURATION_FILE; then - SEARCH_ENGINE_PASSWORD=$(grep "SEARCH_ENGINE_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "XMPP_PASSWORD" $CONFIGURATION_FILE; then - XMPP_PASSWORD=$(grep "XMPP_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "RSS_READER_REPO" $CONFIGURATION_FILE; then - RSS_READER_REPO=$(grep "RSS_READER_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "RSS_MOBILE_READER_REPO" $CONFIGURATION_FILE; then - RSS_MOBILE_READER_REPO=$(grep "RSS_MOBILE_READER_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "RSS_READER_COMMIT" $CONFIGURATION_FILE; then - RSS_READER_COMMIT=$(grep "RSS_READER_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "RSS_MOBILE_READER_COMMIT" $CONFIGURATION_FILE; then - RSS_MOBILE_READER_COMMIT=$(grep "RSS_MOBILE_READER_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "RSS_READER_ADMIN_PASSWORD" $CONFIGURATION_FILE; then - RSS_READER_ADMIN_PASSWORD=$(grep "RSS_READER_ADMIN_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "RSS_READER_DOMAIN_NAME" $CONFIGURATION_FILE; then - RSS_READER_DOMAIN_NAME=$(grep "RSS_READER_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MICROBLOG_BACKGROUND_IMAGE_URL" $CONFIGURATION_FILE; then - MICROBLOG_BACKGROUND_IMAGE_URL=$(grep "MICROBLOG_BACKGROUND_IMAGE_URL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE; then - MICROBLOG_WELCOME_MESSAGE=$(grep "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "PROJECT_WEBSITE" $CONFIGURATION_FILE; then - PROJECT_WEBSITE=$(grep "PROJECT_WEBSITE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "PROJECT_REPO" $CONFIGURATION_FILE; then - PROJECT_REPO=$(grep "PROJECT_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ONION_ONLY" $CONFIGURATION_FILE; then - ONION_ONLY=$(grep "ONION_ONLY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "IRC_PASSWORD" $CONFIGURATION_FILE; then - IRC_PASSWORD=$(grep "IRC_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DEFAULT_LANGUAGE" $CONFIGURATION_FILE; then - DEFAULT_LANGUAGE=$(grep "DEFAULT_LANGUAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MINIMAL_INSTALL" $CONFIGURATION_FILE; then - MINIMAL_INSTALL=$(grep "MINIMAL_INSTALL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "LETSENCRYPT_SERVER" $CONFIGURATION_FILE; then - LETSENCRYPT_SERVER=$(grep "LETSENCRYPT_SERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "FULLBLOG_REPO" $CONFIGURATION_FILE; then - FULLBLOG_REPO=$(grep "FULLBLOG_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "FULLBLOG_COMMIT" $CONFIGURATION_FILE; then - FULLBLOG_COMMIT=$(grep "FULLBLOG_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GOGS_COMMIT" $CONFIGURATION_FILE; then - GOGS_COMMIT=$(grep "GOGS_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TOXCORE_COMMIT" $CONFIGURATION_FILE; then - TOXCORE_COMMIT=$(grep "TOXCORE_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TOXIC_COMMIT" $CONFIGURATION_FILE; then - TOXIC_COMMIT=$(grep "TOXIC_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GPGIT_REPO" $CONFIGURATION_FILE; then - GPGIT_REPO=$(grep "GPGIT_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GPGIT_COMMIT" $CONFIGURATION_FILE; then - GPGIT_COMMIT=$(grep "GPGIT_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "HUBZILLA_REPO" $CONFIGURATION_FILE; then - HUBZILLA_REPO=$(grep "HUBZILLA_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "HUBZILLA_COMMIT" $CONFIGURATION_FILE; then - HUBZILLA_COMMIT=$(grep "HUBZILLA_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "IPFS_COMMIT" $CONFIGURATION_FILE; then - IPFS_COMMIT=$(grep "IPFS_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ZERONET_BLOG_COMMIT" $CONFIGURATION_FILE; then - ZERONET_BLOG_COMMIT=$(grep "ZERONET_BLOG_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ZERONET_MAIL_COMMIT" $CONFIGURATION_FILE; then - ZERONET_MAIL_COMMIT=$(grep "ZERONET_MAIL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ZERONET_FORUM_COMMIT" $CONFIGURATION_FILE; then - ZERONET_FORUM_COMMIT=$(grep "ZERONET_FORUM_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MICROBLOG_COMMIT" $CONFIGURATION_FILE; then - MICROBLOG_COMMIT=$(grep "MICROBLOG_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "NGINX_ENSITE_REPO" $CONFIGURATION_FILE; then - NGINX_ENSITE_REPO=$(grep "NGINX_ENSITE_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "NGINX_ENSITE_COMMIT" $CONFIGURATION_FILE; then - NGINX_ENSITE_COMMIT=$(grep "NGINX_ENSITE_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE; then - CLEANUP_MAILDIR_COMMIT=$(grep "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "CLEANUP_MAILDIR_REPO" $CONFIGURATION_FILE; then - CLEANUP_MAILDIR_REPO=$(grep "CLEANUP_MAILDIR_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ZERONET_COMMIT" $CONFIGURATION_FILE; then - ZERONET_COMMIT=$(grep "ZERONET_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "INADYN_REPO" $CONFIGURATION_FILE; then - INADYN_REPO=$(grep "INADYN_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "INADYN_COMMIT" $CONFIGURATION_FILE; then - INADYN_COMMIT=$(grep "INADYN_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GPG_KEYSERVER" $CONFIGURATION_FILE; then - GPG_KEYSERVER=$(grep "GPG_KEYSERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "IPFS_PORT" $CONFIGURATION_FILE; then - IPFS_PORT=$(grep "IPFS_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TRACKER_PORT" $CONFIGURATION_FILE; then - TRACKER_PORT=$(grep "TRACKER_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ZERONET_PORT" $CONFIGURATION_FILE; then - ZERONET_PORT=$(grep "ZERONET_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DH_KEYLENGTH" $CONFIGURATION_FILE; then - DH_KEYLENGTH=$(grep "DH_KEYLENGTH" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "IRC_PORT" $CONFIGURATION_FILE; then - IRC_PORT=$(grep "IRC_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIFI_CHANNEL" $CONFIGURATION_FILE; then - WIFI_CHANNEL=$(grep "WIFI_CHANNEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "BATMAN_CELLID" $CONFIGURATION_FILE; then - BATMAN_CELLID=$(grep "BATMAN_CELLID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TOX_PORT" $CONFIGURATION_FILE; then - TOX_PORT=$(grep "TOX_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TOX_NODES" $CONFIGURATION_FILE; then - TOX_NODES=$(grep "TOX_NODES" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TOXCORE_REPO" $CONFIGURATION_FILE; then - TOXCORE_REPO=$(grep "TOXCORE_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ENABLE_SOCIAL_KEY_MANAGEMENT" $CONFIGURATION_FILE; then - ENABLE_SOCIAL_KEY_MANAGEMENT=$(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "IPV6_NETWORK" $CONFIGURATION_FILE; then - IPV6_NETWORK=$(grep "IPV6_NETWORK" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "HWRNG_TYPE" $CONFIGURATION_FILE; then - HWRNG_TYPE=$(grep "HWRNG_TYPE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE; then - MEDIAGOBLIN_DOMAIN_NAME=$(grep "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE; then - MEDIAGOBLIN_CODE=$(grep "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MEDIAGOBLIN_REPO" $CONFIGURATION_FILE; then - MEDIAGOBLIN_REPO=$(grep "MEDIAGOBLIN_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MEDIAGOBLIN_COMMIT" $CONFIGURATION_FILE; then - MEDIAGOBLIN_COMMIT=$(grep "MEDIAGOBLIN_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GIT_ADMIN_PASSWORD" $CONFIGURATION_FILE; then - GIT_ADMIN_PASSWORD=$(grep "GIT_ADMIN_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GIT_DOMAIN_NAME" $CONFIGURATION_FILE; then - GIT_DOMAIN_NAME=$(grep "GIT_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GIT_CODE" $CONFIGURATION_FILE; then - GIT_CODE=$(grep "GIT_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SYSTEM_TYPE" $CONFIGURATION_FILE; then - SYSTEM_TYPE=$(grep "SYSTEM_TYPE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSL_PROTOCOLS" $CONFIGURATION_FILE; then - SSL_PROTOCOLS=$(grep "SSL_PROTOCOLS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSL_CIPHERS" $CONFIGURATION_FILE; then - SSL_CIPHERS=$(grep "SSL_CIPHERS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSH_CIPHERS" $CONFIGURATION_FILE; then - SSH_CIPHERS=$(grep "SSH_CIPHERS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSH_MACS" $CONFIGURATION_FILE; then - SSH_MACS=$(grep "SSH_MACS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSH_KEX" $CONFIGURATION_FILE; then - SSH_KEX=$(grep "SSH_KEX" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSH_HOST_KEY_ALGORITHMS" $CONFIGURATION_FILE; then - SSH_HOST_KEY_ALGORITHMS=$(grep "SSH_HOST_KEY_ALGORITHMS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSH_PASSWORDS" $CONFIGURATION_FILE; then - SSH_PASSWORDS=$(grep "SSH_PASSWORDS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "XMPP_CIPHERS" $CONFIGURATION_FILE; then - XMPP_CIPHERS=$(grep "XMPP_CIPHERS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "XMPP_ECC_CURVE" $CONFIGURATION_FILE; then - XMPP_ECC_CURVE=$(grep "XMPP_ECC_CURVE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_USERNAME" $CONFIGURATION_FILE; then - MY_USERNAME=$(grep "MY_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DOMAIN_NAME" $CONFIGURATION_FILE; then - # for backwards compatability - DEFAULT_DOMAIN_NAME=$(grep "DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DEFAULT_DOMAIN_NAME" $CONFIGURATION_FILE; then - DEFAULT_DOMAIN_NAME=$(grep "DEFAULT_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DEFAULT_DOMAIN_CODE" $CONFIGURATION_FILE; then - DEFAULT_DOMAIN_CODE=$(grep "DEFAULT_DOMAIN_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "NAMESERVER1" $CONFIGURATION_FILE; then - NAMESERVER1=$(grep "NAMESERVER1" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "NAMESERVER2" $CONFIGURATION_FILE; then - NAMESERVER2=$(grep "NAMESERVER2" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DEBIAN_REPO" $CONFIGURATION_FILE; then - DEBIAN_REPO=$(grep "DEBIAN_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - CHECK_MESSAGE=$"Check your internet connection, /etc/network/interfaces and /etc/resolv.conf, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list." - fi - if grep -q "VOIP_PORT" $CONFIGURATION_FILE; then - VOIP_PORT=$(grep "VOIP_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "VOIP_SERVER_PASSWORD" $CONFIGURATION_FILE; then - VOIP_SERVER_PASSWORD=$(grep "VOIP_SERVER_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SIP_PORT" $CONFIGURATION_FILE; then - SIP_PORT=$(grep "SIP_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SIP_TLS_PORT" $CONFIGURATION_FILE; then - SIP_TLS_PORT=$(grep "SIP_TLS_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SIP_SERVER_PASSWORD" $CONFIGURATION_FILE; then - SIP_SERVER_PASSWORD=$(grep "SIP_SERVER_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GET_IP_ADDRESS_URL" $CONFIGURATION_FILE; then - GET_IP_ADDRESS_URL=$(grep "GET_IP_ADDRESS_URL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DDNS_PROVIDER" $CONFIGURATION_FILE; then - DDNS_PROVIDER=$(grep "DDNS_PROVIDER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DDNS_USERNAME" $CONFIGURATION_FILE; then - DDNS_USERNAME=$(grep "DDNS_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "DDNS_PASSWORD" $CONFIGURATION_FILE; then - DDNS_PASSWORD=$(grep "DDNS_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE; then - LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ENABLE_BABEL" $CONFIGURATION_FILE; then - ENABLE_BABEL=$(grep "ENABLE_BABEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ENABLE_BATMAN" $CONFIGURATION_FILE; then - ENABLE_BATMAN=$(grep "ENABLE_BATMAN" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ENABLE_CJDNS" $CONFIGURATION_FILE; then - ENABLE_CJDNS=$(grep "ENABLE_CJDNS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "CJDNS_COMMIT" $CONFIGURATION_FILE; then - CJDNS_COMMIT=$(grep "CJDNS_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "CJDNS_IPV6" $CONFIGURATION_FILE; then - CJDNS_IPV6=$(grep "CJDNS_IPV6" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "CJDNS_PUBLIC_KEY" $CONFIGURATION_FILE; then - CJDNS_PUBLIC_KEY=$(grep "CJDNS_PUBLIC_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "CJDNS_PRIVATE_KEY" $CONFIGURATION_FILE; then - CJDNS_PRIVATE_KEY=$(grep "CJDNS_PRIVATE_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE; then - ROUTER_IP_ADDRESS=$(grep "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "CPU_CORES" $CONFIGURATION_FILE; then - CPU_CORES=$(grep "CPU_CORES" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE; then - WEBSERVER_LOG_LEVEL=$(grep "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "ROUTE_THROUGH_TOR" $CONFIGURATION_FILE; then - ROUTE_THROUGH_TOR=$(grep "ROUTE_THROUGH_TOR" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIKI_TITLE" $CONFIGURATION_FILE; then - WIKI_TITLE=$(grep "WIKI_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_NAME" $CONFIGURATION_FILE; then - MY_NAME=$(grep "MY_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_EMAIL_ADDRESS" $CONFIGURATION_FILE; then - MY_EMAIL_ADDRESS=$(grep "MY_EMAIL_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "INSTALLING_ON_BBB" $CONFIGURATION_FILE; then - INSTALLING_ON_BBB=$(grep "INSTALLING_ON_BBB" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "SSH_PORT" $CONFIGURATION_FILE; then - SSH_PORT=$(grep "SSH_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "INSTALLED_WITHIN_DOCKER" $CONFIGURATION_FILE; then - INSTALLED_WITHIN_DOCKER=$(grep "INSTALLED_WITHIN_DOCKER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "PUBLIC_MAILING_LIST" $CONFIGURATION_FILE; then - PUBLIC_MAILING_LIST=$(grep "PUBLIC_MAILING_LIST" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then - MICROBLOG_DOMAIN_NAME=$(grep "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MICROBLOG_CODE" $CONFIGURATION_FILE; then - MICROBLOG_CODE=$(grep "MICROBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE; then - HUBZILLA_DOMAIN_NAME=$(grep "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "HUBZILLA_CODE" $CONFIGURATION_FILE; then - HUBZILLA_CODE=$(grep "HUBZILLA_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE; then - WIKI_DOMAIN_NAME=$(grep "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "WIKI_CODE" $CONFIGURATION_FILE; then - WIKI_CODE=$(grep "WIKI_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then - FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "FULLBLOG_CODE" $CONFIGURATION_FILE; then - FULLBLOG_CODE=$(grep "FULLBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_BLOG_TITLE" $CONFIGURATION_FILE; then - MY_BLOG_TITLE=$(grep "MY_BLOG_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_BLOG_SUBTITLE" $CONFIGURATION_FILE; then - MY_BLOG_SUBTITLE=$(grep "MY_BLOG_SUBTITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "GPG_ENCRYPT_STORED_EMAIL" $CONFIGURATION_FILE; then - GPG_ENCRYPT_STORED_EMAIL=$(grep "GPG_ENCRYPT_STORED_EMAIL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_GPG_PUBLIC_KEY" $CONFIGURATION_FILE; then - MY_GPG_PUBLIC_KEY=$(grep "MY_GPG_PUBLIC_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_GPG_PRIVATE_KEY" $CONFIGURATION_FILE; then - MY_GPG_PRIVATE_KEY=$(grep "MY_GPG_PRIVATE_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MY_GPG_PUBLIC_KEY_ID" $CONFIGURATION_FILE; then - MY_GPG_PUBLIC_KEY_ID=$(grep "MY_GPG_PUBLIC_KEY_ID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "USB_DRIVE" $CONFIGURATION_FILE; then - USB_DRIVE=$(grep "USB_DRIVE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "MAX_PHP_MEMORY" $CONFIGURATION_FILE; then - MAX_PHP_MEMORY=$(grep "MAX_PHP_MEMORY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TLS_TIME_SOURCE1" $CONFIGURATION_FILE; then - TLS_TIME_SOURCE1=$(grep "TLS_TIME_SOURCE1" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TLS_TIME_SOURCE2" $CONFIGURATION_FILE; then - TLS_TIME_SOURCE2=$(grep "TLS_TIME_SOURCE2" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi + # Ensure that a copy of the config exists for upgrade purposes + if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then + cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg + fi + if grep -q "REFRESH_GPG_KEYS_HOURS" $CONFIGURATION_FILE; then + REFRESH_GPG_KEYS_HOURS=$(grep "REFRESH_GPG_KEYS_HOURS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WEBMAIL_REPO" $CONFIGURATION_FILE; then + WEBMAIL_REPO=$(grep "WEBMAIL_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WEBMAIL_COMMIT" $CONFIGURATION_FILE; then + WEBMAIL_COMMIT=$(grep "WEBMAIL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_INTERFACE" $CONFIGURATION_FILE; then + WIFI_INTERFACE=$(grep "WIFI_INTERFACE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_SSID" $CONFIGURATION_FILE; then + WIFI_SSID=$(grep "WIFI_SSID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_TYPE" $CONFIGURATION_FILE; then + WIFI_TYPE=$(grep "WIFI_TYPE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_PASSPHRASE" $CONFIGURATION_FILE; then + WIFI_PASSPHRASE=$(grep "WIFI_PASSPHRASE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_HOTSPOT" $CONFIGURATION_FILE; then + WIFI_HOTSPOT=$(grep "WIFI_HOTSPOT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_NETWORKS_FILE" $CONFIGURATION_FILE; then + WIFI_NETWORKS_FILE=$(grep "WIFI_NETWORKS_FILE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYNCTHING_ID" $CONFIGURATION_FILE; then + SYNCTHING_ID=$(grep "SYNCTHING_ID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYNCTHING_CONFIG_PATH" $CONFIGURATION_FILE; then + SYNCTHING_CONFIG_PATH=$(grep "SYNCTHING_CONFIG_PATH" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYNCTHING_CONFIG_FILE" $CONFIGURATION_FILE; then + SYNCTHING_CONFIG_FILE=$(grep "SYNCTHING_CONFIG_FILE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYNCTHING_RELAY_SERVER" $CONFIGURATION_FILE; then + SYNCTHING_RELAY_SERVER=$(grep "SYNCTHING_RELAY_SERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYNCTHING_RELEASES" $CONFIGURATION_FILE; then + SYNCTHING_RELEASES=$(grep "SYNCTHING_RELEASES" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYNCTHING_PORT" $CONFIGURATION_FILE; then + SYNCTHING_PORT=$(grep "SYNCTHING_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYNCTHING_SHARED_DATA" $CONFIGURATION_FILE; then + SYNCTHING_SHARED_DATA=$(grep "SYNCTHING_SHARED_DATA" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TURN_PORT" $CONFIGURATION_FILE; then + TURN_PORT=$(grep "TURN_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TURN_TLS_PORT" $CONFIGURATION_FILE; then + TURN_TLS_PORT=$(grep "TURN_TLS_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TURN_NONCE" $CONFIGURATION_FILE; then + TURN_NONCE=$(grep "TURN_NONCE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DEFAULT_SEARCH" $CONFIGURATION_FILE; then + DEFAULT_SEARCH=$(grep "DEFAULT_SEARCH" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SEARCH_ENGINE_PASSWORD" $CONFIGURATION_FILE; then + SEARCH_ENGINE_PASSWORD=$(grep "SEARCH_ENGINE_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "XMPP_PASSWORD" $CONFIGURATION_FILE; then + XMPP_PASSWORD=$(grep "XMPP_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "RSS_READER_REPO" $CONFIGURATION_FILE; then + RSS_READER_REPO=$(grep "RSS_READER_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "RSS_MOBILE_READER_REPO" $CONFIGURATION_FILE; then + RSS_MOBILE_READER_REPO=$(grep "RSS_MOBILE_READER_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "RSS_READER_COMMIT" $CONFIGURATION_FILE; then + RSS_READER_COMMIT=$(grep "RSS_READER_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "RSS_MOBILE_READER_COMMIT" $CONFIGURATION_FILE; then + RSS_MOBILE_READER_COMMIT=$(grep "RSS_MOBILE_READER_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "RSS_READER_ADMIN_PASSWORD" $CONFIGURATION_FILE; then + RSS_READER_ADMIN_PASSWORD=$(grep "RSS_READER_ADMIN_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "RSS_READER_DOMAIN_NAME" $CONFIGURATION_FILE; then + RSS_READER_DOMAIN_NAME=$(grep "RSS_READER_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MICROBLOG_BACKGROUND_IMAGE_URL" $CONFIGURATION_FILE; then + MICROBLOG_BACKGROUND_IMAGE_URL=$(grep "MICROBLOG_BACKGROUND_IMAGE_URL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE; then + MICROBLOG_WELCOME_MESSAGE=$(grep "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "PROJECT_WEBSITE" $CONFIGURATION_FILE; then + PROJECT_WEBSITE=$(grep "PROJECT_WEBSITE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "PROJECT_REPO" $CONFIGURATION_FILE; then + PROJECT_REPO=$(grep "PROJECT_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ONION_ONLY" $CONFIGURATION_FILE; then + ONION_ONLY=$(grep "ONION_ONLY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "IRC_PASSWORD" $CONFIGURATION_FILE; then + IRC_PASSWORD=$(grep "IRC_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DEFAULT_LANGUAGE" $CONFIGURATION_FILE; then + DEFAULT_LANGUAGE=$(grep "DEFAULT_LANGUAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MINIMAL_INSTALL" $CONFIGURATION_FILE; then + MINIMAL_INSTALL=$(grep "MINIMAL_INSTALL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "LETSENCRYPT_SERVER" $CONFIGURATION_FILE; then + LETSENCRYPT_SERVER=$(grep "LETSENCRYPT_SERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "FULLBLOG_REPO" $CONFIGURATION_FILE; then + FULLBLOG_REPO=$(grep "FULLBLOG_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "FULLBLOG_COMMIT" $CONFIGURATION_FILE; then + FULLBLOG_COMMIT=$(grep "FULLBLOG_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GOGS_COMMIT" $CONFIGURATION_FILE; then + GOGS_COMMIT=$(grep "GOGS_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TOXCORE_COMMIT" $CONFIGURATION_FILE; then + TOXCORE_COMMIT=$(grep "TOXCORE_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TOXIC_COMMIT" $CONFIGURATION_FILE; then + TOXIC_COMMIT=$(grep "TOXIC_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GPGIT_REPO" $CONFIGURATION_FILE; then + GPGIT_REPO=$(grep "GPGIT_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GPGIT_COMMIT" $CONFIGURATION_FILE; then + GPGIT_COMMIT=$(grep "GPGIT_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "HUBZILLA_REPO" $CONFIGURATION_FILE; then + HUBZILLA_REPO=$(grep "HUBZILLA_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "HUBZILLA_COMMIT" $CONFIGURATION_FILE; then + HUBZILLA_COMMIT=$(grep "HUBZILLA_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "IPFS_COMMIT" $CONFIGURATION_FILE; then + IPFS_COMMIT=$(grep "IPFS_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ZERONET_BLOG_COMMIT" $CONFIGURATION_FILE; then + ZERONET_BLOG_COMMIT=$(grep "ZERONET_BLOG_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ZERONET_MAIL_COMMIT" $CONFIGURATION_FILE; then + ZERONET_MAIL_COMMIT=$(grep "ZERONET_MAIL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ZERONET_FORUM_COMMIT" $CONFIGURATION_FILE; then + ZERONET_FORUM_COMMIT=$(grep "ZERONET_FORUM_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MICROBLOG_COMMIT" $CONFIGURATION_FILE; then + MICROBLOG_COMMIT=$(grep "MICROBLOG_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "NGINX_ENSITE_REPO" $CONFIGURATION_FILE; then + NGINX_ENSITE_REPO=$(grep "NGINX_ENSITE_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "NGINX_ENSITE_COMMIT" $CONFIGURATION_FILE; then + NGINX_ENSITE_COMMIT=$(grep "NGINX_ENSITE_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE; then + CLEANUP_MAILDIR_COMMIT=$(grep "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "CLEANUP_MAILDIR_REPO" $CONFIGURATION_FILE; then + CLEANUP_MAILDIR_REPO=$(grep "CLEANUP_MAILDIR_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ZERONET_COMMIT" $CONFIGURATION_FILE; then + ZERONET_COMMIT=$(grep "ZERONET_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "INADYN_REPO" $CONFIGURATION_FILE; then + INADYN_REPO=$(grep "INADYN_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "INADYN_COMMIT" $CONFIGURATION_FILE; then + INADYN_COMMIT=$(grep "INADYN_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GPG_KEYSERVER" $CONFIGURATION_FILE; then + GPG_KEYSERVER=$(grep "GPG_KEYSERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "IPFS_PORT" $CONFIGURATION_FILE; then + IPFS_PORT=$(grep "IPFS_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TRACKER_PORT" $CONFIGURATION_FILE; then + TRACKER_PORT=$(grep "TRACKER_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ZERONET_PORT" $CONFIGURATION_FILE; then + ZERONET_PORT=$(grep "ZERONET_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DH_KEYLENGTH" $CONFIGURATION_FILE; then + DH_KEYLENGTH=$(grep "DH_KEYLENGTH" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "IRC_PORT" $CONFIGURATION_FILE; then + IRC_PORT=$(grep "IRC_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_CHANNEL" $CONFIGURATION_FILE; then + WIFI_CHANNEL=$(grep "WIFI_CHANNEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "BATMAN_CELLID" $CONFIGURATION_FILE; then + BATMAN_CELLID=$(grep "BATMAN_CELLID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TOX_PORT" $CONFIGURATION_FILE; then + TOX_PORT=$(grep "TOX_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TOX_NODES" $CONFIGURATION_FILE; then + TOX_NODES=$(grep "TOX_NODES" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TOXCORE_REPO" $CONFIGURATION_FILE; then + TOXCORE_REPO=$(grep "TOXCORE_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ENABLE_SOCIAL_KEY_MANAGEMENT" $CONFIGURATION_FILE; then + ENABLE_SOCIAL_KEY_MANAGEMENT=$(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "IPV6_NETWORK" $CONFIGURATION_FILE; then + IPV6_NETWORK=$(grep "IPV6_NETWORK" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "HWRNG_TYPE" $CONFIGURATION_FILE; then + HWRNG_TYPE=$(grep "HWRNG_TYPE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE; then + MEDIAGOBLIN_DOMAIN_NAME=$(grep "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE; then + MEDIAGOBLIN_CODE=$(grep "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MEDIAGOBLIN_REPO" $CONFIGURATION_FILE; then + MEDIAGOBLIN_REPO=$(grep "MEDIAGOBLIN_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MEDIAGOBLIN_COMMIT" $CONFIGURATION_FILE; then + MEDIAGOBLIN_COMMIT=$(grep "MEDIAGOBLIN_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GIT_ADMIN_PASSWORD" $CONFIGURATION_FILE; then + GIT_ADMIN_PASSWORD=$(grep "GIT_ADMIN_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GIT_DOMAIN_NAME" $CONFIGURATION_FILE; then + GIT_DOMAIN_NAME=$(grep "GIT_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GIT_CODE" $CONFIGURATION_FILE; then + GIT_CODE=$(grep "GIT_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SYSTEM_TYPE" $CONFIGURATION_FILE; then + SYSTEM_TYPE=$(grep "SYSTEM_TYPE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSL_PROTOCOLS" $CONFIGURATION_FILE; then + SSL_PROTOCOLS=$(grep "SSL_PROTOCOLS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSL_CIPHERS" $CONFIGURATION_FILE; then + SSL_CIPHERS=$(grep "SSL_CIPHERS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSH_CIPHERS" $CONFIGURATION_FILE; then + SSH_CIPHERS=$(grep "SSH_CIPHERS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSH_MACS" $CONFIGURATION_FILE; then + SSH_MACS=$(grep "SSH_MACS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSH_KEX" $CONFIGURATION_FILE; then + SSH_KEX=$(grep "SSH_KEX" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSH_HOST_KEY_ALGORITHMS" $CONFIGURATION_FILE; then + SSH_HOST_KEY_ALGORITHMS=$(grep "SSH_HOST_KEY_ALGORITHMS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSH_PASSWORDS" $CONFIGURATION_FILE; then + SSH_PASSWORDS=$(grep "SSH_PASSWORDS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "XMPP_CIPHERS" $CONFIGURATION_FILE; then + XMPP_CIPHERS=$(grep "XMPP_CIPHERS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "XMPP_ECC_CURVE" $CONFIGURATION_FILE; then + XMPP_ECC_CURVE=$(grep "XMPP_ECC_CURVE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_USERNAME" $CONFIGURATION_FILE; then + MY_USERNAME=$(grep "MY_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DOMAIN_NAME" $CONFIGURATION_FILE; then + # for backwards compatability + DEFAULT_DOMAIN_NAME=$(grep "DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DEFAULT_DOMAIN_NAME" $CONFIGURATION_FILE; then + DEFAULT_DOMAIN_NAME=$(grep "DEFAULT_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DEFAULT_DOMAIN_CODE" $CONFIGURATION_FILE; then + DEFAULT_DOMAIN_CODE=$(grep "DEFAULT_DOMAIN_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "NAMESERVER1" $CONFIGURATION_FILE; then + NAMESERVER1=$(grep "NAMESERVER1" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "NAMESERVER2" $CONFIGURATION_FILE; then + NAMESERVER2=$(grep "NAMESERVER2" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DEBIAN_REPO" $CONFIGURATION_FILE; then + DEBIAN_REPO=$(grep "DEBIAN_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + CHECK_MESSAGE=$"Check your internet connection, /etc/network/interfaces and /etc/resolv.conf, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list." + fi + if grep -q "MUMBLE_PORT" $CONFIGURATION_FILE; then + MUMBLE_PORT=$(grep "MUMBLE_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MUMBLE_SERVER_PASSWORD" $CONFIGURATION_FILE; then + MUMBLE_SERVER_PASSWORD=$(grep "MUMBLE_SERVER_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SIP_PORT" $CONFIGURATION_FILE; then + SIP_PORT=$(grep "SIP_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SIP_TLS_PORT" $CONFIGURATION_FILE; then + SIP_TLS_PORT=$(grep "SIP_TLS_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SIP_SERVER_PASSWORD" $CONFIGURATION_FILE; then + SIP_SERVER_PASSWORD=$(grep "SIP_SERVER_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GET_IP_ADDRESS_URL" $CONFIGURATION_FILE; then + GET_IP_ADDRESS_URL=$(grep "GET_IP_ADDRESS_URL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DDNS_PROVIDER" $CONFIGURATION_FILE; then + DDNS_PROVIDER=$(grep "DDNS_PROVIDER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DDNS_USERNAME" $CONFIGURATION_FILE; then + DDNS_USERNAME=$(grep "DDNS_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "DDNS_PASSWORD" $CONFIGURATION_FILE; then + DDNS_PASSWORD=$(grep "DDNS_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE; then + LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ENABLE_BABEL" $CONFIGURATION_FILE; then + ENABLE_BABEL=$(grep "ENABLE_BABEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ENABLE_BATMAN" $CONFIGURATION_FILE; then + ENABLE_BATMAN=$(grep "ENABLE_BATMAN" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ENABLE_CJDNS" $CONFIGURATION_FILE; then + ENABLE_CJDNS=$(grep "ENABLE_CJDNS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "CJDNS_COMMIT" $CONFIGURATION_FILE; then + CJDNS_COMMIT=$(grep "CJDNS_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "CJDNS_IPV6" $CONFIGURATION_FILE; then + CJDNS_IPV6=$(grep "CJDNS_IPV6" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "CJDNS_PUBLIC_KEY" $CONFIGURATION_FILE; then + CJDNS_PUBLIC_KEY=$(grep "CJDNS_PUBLIC_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "CJDNS_PRIVATE_KEY" $CONFIGURATION_FILE; then + CJDNS_PRIVATE_KEY=$(grep "CJDNS_PRIVATE_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE; then + ROUTER_IP_ADDRESS=$(grep "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "CPU_CORES" $CONFIGURATION_FILE; then + CPU_CORES=$(grep "CPU_CORES" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE; then + WEBSERVER_LOG_LEVEL=$(grep "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "ROUTE_THROUGH_TOR" $CONFIGURATION_FILE; then + ROUTE_THROUGH_TOR=$(grep "ROUTE_THROUGH_TOR" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIKI_TITLE" $CONFIGURATION_FILE; then + WIKI_TITLE=$(grep "WIKI_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_NAME" $CONFIGURATION_FILE; then + MY_NAME=$(grep "MY_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_EMAIL_ADDRESS" $CONFIGURATION_FILE; then + MY_EMAIL_ADDRESS=$(grep "MY_EMAIL_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "INSTALLING_ON_BBB" $CONFIGURATION_FILE; then + INSTALLING_ON_BBB=$(grep "INSTALLING_ON_BBB" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "SSH_PORT" $CONFIGURATION_FILE; then + SSH_PORT=$(grep "SSH_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "INSTALLED_WITHIN_DOCKER" $CONFIGURATION_FILE; then + INSTALLED_WITHIN_DOCKER=$(grep "INSTALLED_WITHIN_DOCKER" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "PUBLIC_MAILING_LIST" $CONFIGURATION_FILE; then + PUBLIC_MAILING_LIST=$(grep "PUBLIC_MAILING_LIST" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then + MICROBLOG_DOMAIN_NAME=$(grep "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MICROBLOG_CODE" $CONFIGURATION_FILE; then + MICROBLOG_CODE=$(grep "MICROBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE; then + HUBZILLA_DOMAIN_NAME=$(grep "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "HUBZILLA_CODE" $CONFIGURATION_FILE; then + HUBZILLA_CODE=$(grep "HUBZILLA_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE; then + WIKI_DOMAIN_NAME=$(grep "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIKI_CODE" $CONFIGURATION_FILE; then + WIKI_CODE=$(grep "WIKI_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then + FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "FULLBLOG_CODE" $CONFIGURATION_FILE; then + FULLBLOG_CODE=$(grep "FULLBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_BLOG_TITLE" $CONFIGURATION_FILE; then + MY_BLOG_TITLE=$(grep "MY_BLOG_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_BLOG_SUBTITLE" $CONFIGURATION_FILE; then + MY_BLOG_SUBTITLE=$(grep "MY_BLOG_SUBTITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "GPG_ENCRYPT_STORED_EMAIL" $CONFIGURATION_FILE; then + GPG_ENCRYPT_STORED_EMAIL=$(grep "GPG_ENCRYPT_STORED_EMAIL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_GPG_PUBLIC_KEY" $CONFIGURATION_FILE; then + MY_GPG_PUBLIC_KEY=$(grep "MY_GPG_PUBLIC_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_GPG_PRIVATE_KEY" $CONFIGURATION_FILE; then + MY_GPG_PRIVATE_KEY=$(grep "MY_GPG_PRIVATE_KEY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MY_GPG_PUBLIC_KEY_ID" $CONFIGURATION_FILE; then + MY_GPG_PUBLIC_KEY_ID=$(grep "MY_GPG_PUBLIC_KEY_ID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "USB_DRIVE" $CONFIGURATION_FILE; then + USB_DRIVE=$(grep "USB_DRIVE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "MAX_PHP_MEMORY" $CONFIGURATION_FILE; then + MAX_PHP_MEMORY=$(grep "MAX_PHP_MEMORY" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TLS_TIME_SOURCE1" $CONFIGURATION_FILE; then + TLS_TIME_SOURCE1=$(grep "TLS_TIME_SOURCE1" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "TLS_TIME_SOURCE2" $CONFIGURATION_FILE; then + TLS_TIME_SOURCE2=$(grep "TLS_TIME_SOURCE2" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi fi echo "System type: $SYSTEM_TYPE" } @@ -485,121 +485,121 @@ function read_configuration { # check that domain names are sensible function check_domains { if [ ${#WIKI_DOMAIN_NAME} -gt 1 ]; then - function_check test_domain_name - test_domain_name "$WIKI_DOMAIN_NAME" + function_check test_domain_name + test_domain_name "$WIKI_DOMAIN_NAME" - if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then - echo $'Wiki domain name is the same as blog domain name. They must be different' - exit 97326 - fi - if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then - echo $'Wiki domain name is the same as microblog domain name. They must be different' - exit 36827 - fi - if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then - echo $'Wiki domain name is the same as hubzilla domain name. They must be different' - exit 65848 - fi - if [ ${#GIT_DOMAIN_NAME} -gt 1 ]; then - if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then - echo $'Wiki domain name is the same as Gogs domain name. They must be different' - exit 73529 - fi - fi + if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then + echo $'Wiki domain name is the same as blog domain name. They must be different' + exit 97326 + fi + if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then + echo $'Wiki domain name is the same as microblog domain name. They must be different' + exit 36827 + fi + if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then + echo $'Wiki domain name is the same as hubzilla domain name. They must be different' + exit 65848 + fi + if [ ${#GIT_DOMAIN_NAME} -gt 1 ]; then + if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then + echo $'Wiki domain name is the same as Gogs domain name. They must be different' + exit 73529 + fi + fi fi if [ ${#FULLBLOG_DOMAIN_NAME} -gt 1 ]; then - function_check test_domain_name - test_domain_name "$FULLBLOG_DOMAIN_NAME" + function_check test_domain_name + test_domain_name "$FULLBLOG_DOMAIN_NAME" - if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then - echo $'Blog domain name is the same as wiki domain name. They must be different' - exit 62348 - fi - if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then - echo $'Blog domain name is the same as microblog domain name. They must be different' - exit 38236 - fi - if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then - echo $'Blog domain name is the same as hubzilla domain name. They must be different' - exit 35483 - fi - if [ $GIT_DOMAIN_NAME ]; then - if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then - echo $'Blog domain name is the same as Gogs domain name. They must be different' - exit 84695 - fi - fi + if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then + echo $'Blog domain name is the same as wiki domain name. They must be different' + exit 62348 + fi + if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then + echo $'Blog domain name is the same as microblog domain name. They must be different' + exit 38236 + fi + if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then + echo $'Blog domain name is the same as hubzilla domain name. They must be different' + exit 35483 + fi + if [ $GIT_DOMAIN_NAME ]; then + if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then + echo $'Blog domain name is the same as Gogs domain name. They must be different' + exit 84695 + fi + fi fi if [ ${#MICROBLOG_DOMAIN_NAME} -gt 1 ]; then - function_check test_domain_name - test_domain_name "$MICROBLOG_DOMAIN_NAME" + function_check test_domain_name + test_domain_name "$MICROBLOG_DOMAIN_NAME" - if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then - echo $'Microblog domain name is the same as wiki domain name. They must be different' - exit 73924 - fi - if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then - echo $'Microblog domain name is the same as blog domain name. They must be different' - exit 26832 - fi - if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then - echo $'Microblog domain name is the same as hubzilla domain name. They must be different' - exit 678382 - fi - if [ $GIT_DOMAIN_NAME ]; then - if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then - echo $'Microblog domain name is the same as Gogs domain name. They must be different' - exit 684325 - fi - fi + if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then + echo $'Microblog domain name is the same as wiki domain name. They must be different' + exit 73924 + fi + if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then + echo $'Microblog domain name is the same as blog domain name. They must be different' + exit 26832 + fi + if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then + echo $'Microblog domain name is the same as hubzilla domain name. They must be different' + exit 678382 + fi + if [ $GIT_DOMAIN_NAME ]; then + if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then + echo $'Microblog domain name is the same as Gogs domain name. They must be different' + exit 684325 + fi + fi fi if [ $HUBZILLA_DOMAIN_NAME ]; then - function_check test_domain_name - test_domain_name "$HUBZILLA_DOMAIN_NAME" + function_check test_domain_name + test_domain_name "$HUBZILLA_DOMAIN_NAME" - if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then - echo $'Hubzilla domain name is the same as wiki domain name. They must be different' - exit 83682 - fi - if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then - echo $'Hubzilla domain name is the same as blog domain name. They must be different' - exit 74817 - fi - if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then - echo $'Hubzilla domain name is the same as microblog domain name. They must be different' - exit 83683 - fi - if [ ${#GIT_DOMAIN_NAME} -gt 1 ]; then - if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then - echo $'Hubzilla domain name is the same as Gogs domain name. They must be different' - exit 135523 - fi - fi + if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then + echo $'Hubzilla domain name is the same as wiki domain name. They must be different' + exit 83682 + fi + if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then + echo $'Hubzilla domain name is the same as blog domain name. They must be different' + exit 74817 + fi + if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then + echo $'Hubzilla domain name is the same as microblog domain name. They must be different' + exit 83683 + fi + if [ ${#GIT_DOMAIN_NAME} -gt 1 ]; then + if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then + echo $'Hubzilla domain name is the same as Gogs domain name. They must be different' + exit 135523 + fi + fi fi if [ ${#GIT_DOMAIN_NAME} -gt 1 ]; then - function_check test_domain_name - test_domain_name "$GIT_DOMAIN_NAME" + function_check test_domain_name + test_domain_name "$GIT_DOMAIN_NAME" - if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then - echo $'Hubzilla domain name is the same as wiki domain name. They must be different' - exit 83682 - fi - if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then - echo $'Hubzilla domain name is the same as blog domain name. They must be different' - exit 74817 - fi - if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then - echo $'Hubzilla domain name is the same as microblog domain name. They must be different' - exit 83683 - fi - if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then - echo $'Microblog domain name is the same as hubzilla domain name. They must be different' - exit 678382 - fi + if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then + echo $'Hubzilla domain name is the same as wiki domain name. They must be different' + exit 83682 + fi + if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then + echo $'Hubzilla domain name is the same as blog domain name. They must be different' + exit 74817 + fi + if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then + echo $'Hubzilla domain name is the same as microblog domain name. They must be different' + exit 83683 + fi + if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then + echo $'Microblog domain name is the same as hubzilla domain name. They must be different' + exit 678382 + fi fi } diff --git a/src/freedombone-utils-help b/src/freedombone-utils-help index 265c352a..7a70b059 100755 --- a/src/freedombone-utils-help +++ b/src/freedombone-utils-help @@ -29,53 +29,53 @@ # along with this program. If not, see . function show_help { - echo '' - echo $"${PROJECT_NAME} -c [configuration file]" - echo '' - echo $' -h --help Show help' - echo $' menuconfig Easy interactive installation' - echo $' menuconfig-full Full interactive installation' - echo $' menuconfig-onion Interactive installation for onion-only sites' - echo $' -c --config Installing from a configuration file' - echo $' --bbb Installing on Beaglebone Black' - echo $' -u --user User to install the system as' - echo $' -d --domain Default domain name' - echo $' -s --system System type' - echo $' --ip Static LAN IP address of the system' - echo $' --iprouter LAN IP address of the internet router' - echo $' --ddns Dynamic DNS provider domain' - echo $' --ddnsuser Dynamic DNS provider username' - echo $' --ddnspass Dynamic DNS provider password' - echo '' - echo $' --microblogdomain Microblog domain name' - echo $' --wikidomain Wiki domain name' - echo $' --blogdomain Blog domain name' - echo $' --hubzilladomain Hubzilla domain name' - echo $' --gitdomain Git hosting domain name' - echo $' -t --time Domain used as a TLS time source' - echo $' --ssh ssh port number' - echo $' --list Public mailing list name' - echo $' --cores Number of CPU cores' - echo $' --name Your name' - echo $' --email Your email address' - echo $' --usb Path for the USB drive (eg. /dev/sdb1)' - echo $' --cjdns Enable CJDNS' - echo $' --vpass VoIP server password' - echo $' --vport VoIP server port' - echo $' --ns1 First DNS nameserver' - echo $' --ns2 Second DNS nameserver' - echo $' --repo Debian repository' - echo '' - echo $'system types' - echo '------------' - echo $'This can either be blank if you wish to install the full system,' - echo $"or for more specialised variants you can specify '$VARIANT_MAILBOX', '$VARIANT_CLOUD'," - echo $"'$VARIANT_CHAT', '$VARIANT_SOCIAL', '$VARIANT_MEDIA', '$VARIANT_WRITER', '$VARIANT_DEVELOPER'" - echo $"or '$VARIANT_MESH'." - echo '' - echo $"If you wish to install everything except email then use the '$VARIANT_NONMAILBOX' variaint." - echo '' - exit 0 + echo '' + echo $"${PROJECT_NAME} -c [configuration file]" + echo '' + echo $' -h --help Show help' + echo $' menuconfig Easy interactive installation' + echo $' menuconfig-full Full interactive installation' + echo $' menuconfig-onion Interactive installation for onion-only sites' + echo $' -c --config Installing from a configuration file' + echo $' --bbb Installing on Beaglebone Black' + echo $' -u --user User to install the system as' + echo $' -d --domain Default domain name' + echo $' -s --system System type' + echo $' --ip Static LAN IP address of the system' + echo $' --iprouter LAN IP address of the internet router' + echo $' --ddns Dynamic DNS provider domain' + echo $' --ddnsuser Dynamic DNS provider username' + echo $' --ddnspass Dynamic DNS provider password' + echo '' + echo $' --microblogdomain Microblog domain name' + echo $' --wikidomain Wiki domain name' + echo $' --blogdomain Blog domain name' + echo $' --hubzilladomain Hubzilla domain name' + echo $' --gitdomain Git hosting domain name' + echo $' -t --time Domain used as a TLS time source' + echo $' --ssh ssh port number' + echo $' --list Public mailing list name' + echo $' --cores Number of CPU cores' + echo $' --name Your name' + echo $' --email Your email address' + echo $' --usb Path for the USB drive (eg. /dev/sdb1)' + echo $' --cjdns Enable CJDNS' + echo $' --vpass Mumble server password' + echo $' --vport Mumble server port' + echo $' --ns1 First DNS nameserver' + echo $' --ns2 Second DNS nameserver' + echo $' --repo Debian repository' + echo '' + echo $'system types' + echo '------------' + echo $'This can either be blank if you wish to install the full system,' + echo $"or for more specialised variants you can specify '$VARIANT_MAILBOX', '$VARIANT_CLOUD'," + echo $"'$VARIANT_CHAT', '$VARIANT_SOCIAL', '$VARIANT_MEDIA', '$VARIANT_WRITER', '$VARIANT_DEVELOPER'" + echo $"or '$VARIANT_MESH'." + echo '' + echo $"If you wish to install everything except email then use the '$VARIANT_NONMAILBOX' variaint." + echo '' + exit 0 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-utils-upgrade b/src/freedombone-utils-upgrade index d94d35c9..5fcfd2c6 100755 --- a/src/freedombone-utils-upgrade +++ b/src/freedombone-utils-upgrade @@ -61,6 +61,7 @@ function upgrade_installation_from_previous_versions { sed -i 's|install_gnu_social_theme|install_gnusocial_theme|g' $COMPLETION_FILE sed -i 's|install_gnu_social|install_gnusocial|g' $COMPLETION_FILE sed -i 's|install_irc_server|install_irc|g' $COMPLETION_FILE + sed -i 's|voip_turn|turn|g' $COMPLETION_FILE sed -i 's|install_voip|install_mumble|g' $COMPLETION_FILE sed -i 's|install_rss_reader|install_rss|g' $COMPLETION_FILE sed -i 's|install_tox_node|install_tox|g' $COMPLETION_FILE @@ -68,6 +69,8 @@ function upgrade_installation_from_previous_versions { sed -i 's|GNU Social|gnusocial|g' $COMPLETION_FILE sed -i 's|XMPP|xmpp|g' $COMPLETION_FILE + sed -i 's|voip|mumble|g' $COMPLETION_FILE + sed -i 's|VoIP|mumble|g' $COMPLETION_FILE if [ -f /usr/local/bin/zeronetavahi ]; then rm /usr/local/bin/zeronetavahi