Ver código fonte

Use zeronet trackers file

Bob Mottram 9 anos atrás
pai
commit
d048fa72db
3 arquivos alterados com 4 adições e 7 exclusões
  1. 1
    1
      src/freedombone
  2. 1
    1
      src/freedombone-meshweb
  3. 2
    5
      src/zeronetavahi

+ 1
- 1
src/freedombone Ver arquivo

1859
   echo 'User=zeronet' >> /etc/systemd/system/zeronet.service
1859
   echo 'User=zeronet' >> /etc/systemd/system/zeronet.service
1860
   echo 'Group=zeronet' >> /etc/systemd/system/zeronet.service
1860
   echo 'Group=zeronet' >> /etc/systemd/system/zeronet.service
1861
   echo 'WorkingDirectory=/opt/zeronet' >> /etc/systemd/system/zeronet.service
1861
   echo 'WorkingDirectory=/opt/zeronet' >> /etc/systemd/system/zeronet.service
1862
-  echo "ExecStart=/usr/bin/python zeronet.py --ip_external ${DEFAULT_DOMAIN_NAME}.local --config_file /opt/zeronet/zeronet.conf" >> /etc/systemd/system/zeronet.service
1862
+  echo "ExecStart=/usr/bin/python zeronet.py --ip_external ${DEFAULT_DOMAIN_NAME}.local --trackers_file /opt/zeronet/bootstrap" >> /etc/systemd/system/zeronet.service
1863
   echo '' >> /etc/systemd/system/zeronet.service
1863
   echo '' >> /etc/systemd/system/zeronet.service
1864
   echo 'TimeoutSec=300' >> /etc/systemd/system/zeronet.service
1864
   echo 'TimeoutSec=300' >> /etc/systemd/system/zeronet.service
1865
   echo '' >> /etc/systemd/system/zeronet.service
1865
   echo '' >> /etc/systemd/system/zeronet.service

+ 1
- 1
src/freedombone-meshweb Ver arquivo

323
 
323
 
324
 existing_zeronet=$(ps aux | grep zeronet | wc -l)
324
 existing_zeronet=$(ps aux | grep zeronet | wc -l)
325
 if [ $existing_zeronet -lt "2" ]; then
325
 if [ $existing_zeronet -lt "2" ]; then
326
-    python zeronet.py --ip_external $(hostname).local --config_file $ZERONET_DIR/zeronet.conf &
326
+    python zeronet.py --ip_external $(hostname).local --trackers_file $ZERONET_DIR/bootstrap &
327
 fi
327
 fi
328
 
328
 
329
 if which firefox > /dev/null; then
329
 if which firefox > /dev/null; then

+ 2
- 5
src/zeronetavahi Ver arquivo

49
 FORUM_FILE=$ZERONET_INSTALL/freedombone-fora
49
 FORUM_FILE=$ZERONET_INSTALL/freedombone-fora
50
 TOX_USERS_FILE=$ZERONET_INSTALL/freedombone-tox-users
50
 TOX_USERS_FILE=$ZERONET_INSTALL/freedombone-tox-users
51
 ZERONET_INDEX=/home/$MY_USERNAME/mesh.html
51
 ZERONET_INDEX=/home/$MY_USERNAME/mesh.html
52
-ZERONET_CONFIG=$ZERONET_INSTALL/zeronet.conf
52
+ZERONET_CONFIG=$ZERONET_INSTALL/bootstrap
53
 
53
 
54
 function create_index {
54
 function create_index {
55
     if [ -f $ZERONET_INDEX ]; then
55
     if [ -f $ZERONET_INDEX ]; then
123
     rm -f $ZERONET_CONFIG.new
123
     rm -f $ZERONET_CONFIG.new
124
 fi
124
 fi
125
 
125
 
126
-echo '[global]' > $ZERONET_CONFIG.new
127
-echo 'trackers =' >> $ZERONET_CONFIG.new
128
-
129
 state=0
126
 state=0
130
 address=""
127
 address=""
131
 peer=""
128
 peer=""
136
             address=$(echo $line | awk -F '[' '{print $2}' | awk -F ']' '{print $1}')
133
             address=$(echo $line | awk -F '[' '{print $2}' | awk -F ']' '{print $1}')
137
             tracker_url="http://$peer:$TRACKER_PORT/announce"
134
             tracker_url="http://$peer:$TRACKER_PORT/announce"
138
             if ! grep -q "$tracker_url" $ZERONET_CONFIG.new; then
135
             if ! grep -q "$tracker_url" $ZERONET_CONFIG.new; then
139
-                echo "    $tracker_url" >> $ZERONET_CONFIG.new
136
+                echo "$tracker_url" >> $ZERONET_CONFIG.new
140
                 tracker_ctr=$((tracker_ctr + 1))
137
                 tracker_ctr=$((tracker_ctr + 1))
141
             fi
138
             fi
142
             state=0
139
             state=0