From d048fa72db799e1ac22f16c3f6ec4e74fd3e629b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 12 Sep 2015 18:48:34 +0100 Subject: [PATCH] Use zeronet trackers file --- src/freedombone | 2 +- src/freedombone-meshweb | 2 +- src/zeronetavahi | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/freedombone b/src/freedombone index 3041acf1..6e33f71f 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1859,7 +1859,7 @@ function install_zeronet { echo 'User=zeronet' >> /etc/systemd/system/zeronet.service echo 'Group=zeronet' >> /etc/systemd/system/zeronet.service echo 'WorkingDirectory=/opt/zeronet' >> /etc/systemd/system/zeronet.service - echo "ExecStart=/usr/bin/python zeronet.py --ip_external ${DEFAULT_DOMAIN_NAME}.local --config_file /opt/zeronet/zeronet.conf" >> /etc/systemd/system/zeronet.service + echo "ExecStart=/usr/bin/python zeronet.py --ip_external ${DEFAULT_DOMAIN_NAME}.local --trackers_file /opt/zeronet/bootstrap" >> /etc/systemd/system/zeronet.service echo '' >> /etc/systemd/system/zeronet.service echo 'TimeoutSec=300' >> /etc/systemd/system/zeronet.service echo '' >> /etc/systemd/system/zeronet.service diff --git a/src/freedombone-meshweb b/src/freedombone-meshweb index b81e721c..317c02e7 100755 --- a/src/freedombone-meshweb +++ b/src/freedombone-meshweb @@ -323,7 +323,7 @@ zeronetavahi existing_zeronet=$(ps aux | grep zeronet | wc -l) if [ $existing_zeronet -lt "2" ]; then - python zeronet.py --ip_external $(hostname).local --config_file $ZERONET_DIR/zeronet.conf & + python zeronet.py --ip_external $(hostname).local --trackers_file $ZERONET_DIR/bootstrap & fi if which firefox > /dev/null; then diff --git a/src/zeronetavahi b/src/zeronetavahi index eafc8551..3d6d55c4 100755 --- a/src/zeronetavahi +++ b/src/zeronetavahi @@ -49,7 +49,7 @@ BLOGS_FILE=$ZERONET_INSTALL/freedombone-blogs FORUM_FILE=$ZERONET_INSTALL/freedombone-fora TOX_USERS_FILE=$ZERONET_INSTALL/freedombone-tox-users ZERONET_INDEX=/home/$MY_USERNAME/mesh.html -ZERONET_CONFIG=$ZERONET_INSTALL/zeronet.conf +ZERONET_CONFIG=$ZERONET_INSTALL/bootstrap function create_index { if [ -f $ZERONET_INDEX ]; then @@ -123,9 +123,6 @@ if [ -f $ZERONET_CONFIG.new ]; then rm -f $ZERONET_CONFIG.new fi -echo '[global]' > $ZERONET_CONFIG.new -echo 'trackers =' >> $ZERONET_CONFIG.new - state=0 address="" peer="" @@ -136,7 +133,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do address=$(echo $line | awk -F '[' '{print $2}' | awk -F ']' '{print $1}') tracker_url="http://$peer:$TRACKER_PORT/announce" if ! grep -q "$tracker_url" $ZERONET_CONFIG.new; then - echo " $tracker_url" >> $ZERONET_CONFIG.new + echo "$tracker_url" >> $ZERONET_CONFIG.new tracker_ctr=$((tracker_ctr + 1)) fi state=0