From 614906ad050f62d7ed9e86cd205391ce3637e795 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 7 Sep 2016 22:30:12 +0100 Subject: [PATCH] Only list ipfs users who have a tox id --- src/freedombone-image-mesh | 3 ++- src/zeronetavahi | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/freedombone-image-mesh b/src/freedombone-image-mesh index 041fd481..0ca16c52 100755 --- a/src/freedombone-image-mesh +++ b/src/freedombone-image-mesh @@ -799,6 +799,7 @@ function setup_ipfs { fi # make a public directory + TOX_ID='none' if [ -d /home/$MY_USERNAME/Desktop ]; then if [ ! -d /home/$MY_USERNAME/Public ]; then mkdir /home/$MY_USERNAME/Public @@ -811,9 +812,9 @@ function setup_ipfs { exit 368225 fi fi + TOX_ID=$(su -c 'toxid' - $MY_USERNAME) fi - TOX_ID=$(su -c 'toxid' - $MY_USERNAME) create_avahi_mesh_service "ipfs" "ipfs" "udp" "$IPFS_PORT" "${IPFS_PEER_ID}:${TOX_ID}" echo "IPFS installed with ID ${IPFS_PEER_ID}" >> $INSTALL_LOG diff --git a/src/zeronetavahi b/src/zeronetavahi index e4345aea..127dee2c 100755 --- a/src/zeronetavahi +++ b/src/zeronetavahi @@ -132,7 +132,9 @@ function ipfs_bootstrap { ipfs_tox_id=$(echo "$ipfs_txt" | awk -F ':' '{print $2}') $IPFS_COMMAND bootstrap add /ip4/${address}/tcp/${IPFS_PORT}/ipfs/${ipfs_peer_id} if [ -d /home/$MY_USERNAME/Desktop ]; then - echo "$ipfs_tox_id:$ipfs_peer_id" >> ${IPFS_USERS_FILE}.new + if [[ $ipfs_tox_id != 'none' ]]; then + echo "$ipfs_tox_id:$ipfs_peer_id" >> ${IPFS_USERS_FILE}.new + fi fi state=0 fi