From 9f14fbeb60b0afd7ee7569717e2c2d31e04a7003 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 6 Jan 2016 15:54:54 +0000 Subject: [PATCH] Tox onion domain --- src/freedombone | 10 ++++++++++ src/freedombone-controlpanel | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/freedombone b/src/freedombone index 24cb74e4..f75883d6 100755 --- a/src/freedombone +++ b/src/freedombone @@ -6866,7 +6866,16 @@ function install_tox_node { exit 5846 fi + TOX_ONION_HOSTNAME=$(add_onion_service tox ${TOX_PORT} ${TOX_PORT}) + + if ! grep -q "tox onion domain" $COMPLETION_FILE; then + echo "tox onion domain:${TOX_ONION_HOSTNAME}" >> $COMPLETION_FILE + else + sed -i "s|tox onion domain.*|tox onion domain:${TOX_ONION_HOSTNAME}|g" $COMPLETION_FILE + fi + systemctl restart tox-bootstrapd.service + TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1) if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then echo $'Could not obtain the tox node public key' @@ -6883,6 +6892,7 @@ function install_tox_node { echo '' >> /home/$MY_USERNAME/README echo 'Tox' >> /home/$MY_USERNAME/README echo '===' >> /home/$MY_USERNAME/README + echo $"tox onion domain: ${TOX_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README echo $"Your Tox node public key is: $TOX_PUBLIC_KEY" >> /home/$MY_USERNAME/README echo $'In the Toxic client you can connect to it with:' >> /home/$MY_USERNAME/README echo " /connect $DEFAULT_DOMAIN_NAME.local $TOX_PORT $TOX_PUBLIC_KEY" >> /home/$MY_USERNAME/README diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 236bee4d..2f6af5ab 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -163,6 +163,11 @@ function show_domains { echo -n -e "$(pad_string ${DEFAULT_DOMAIN_NAME})" echo "$(cat ${COMPLETION_FILE} | grep 'IRC onion domain' | awk -F ':' '{print $2}')" fi + if grep -q "tox onion domain" $COMPLETION_FILE; then + echo -n -e "$(pad_string 'Tox')" + echo -n -e "$(pad_string ${DEFAULT_DOMAIN_NAME})" + echo "$(cat ${COMPLETION_FILE} | grep 'tox onion domain' | awk -F ':' '{print $2}')" + fi if grep -q "Wiki domain" $COMPLETION_FILE; then echo -n -e "$(pad_string 'Wiki')" WIKIDOM=$(cat ${COMPLETION_FILE} | grep 'Wiki domain' | awk -F ':' '{print $2}')