Browse Source

Switch ipv4 to ipv6 when creating ipfs boostraps

Bob Mottram 7 years ago
parent
commit
3712ca79a7
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/meshavahi

+ 2
- 1
src/meshavahi View File

100
 }
100
 }
101
 
101
 
102
 function ipfs_bootstrap {
102
 function ipfs_bootstrap {
103
+    # TODO switch to ipv6
103
     cat $TEMPFILE_BASE | grep "ipfs_id\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
104
     cat $TEMPFILE_BASE | grep "ipfs_id\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
104
 
105
 
105
     state=0
106
     state=0
114
                 ipfs_txt=$(echo "$line" | awk -F '[' '{print $2}' | awk -F ']' '{print $1}' | awk -F '"' '{print $2}')
115
                 ipfs_txt=$(echo "$line" | awk -F '[' '{print $2}' | awk -F ']' '{print $1}' | awk -F '"' '{print $2}')
115
                 ipfs_peer_id=$(echo "$ipfs_txt" | awk -F ':' '{print $1}')
116
                 ipfs_peer_id=$(echo "$ipfs_txt" | awk -F ':' '{print $1}')
116
                 ipfs_tox_id=$(echo "$ipfs_txt" | awk -F ':' '{print $2}')
117
                 ipfs_tox_id=$(echo "$ipfs_txt" | awk -F ':' '{print $2}')
117
-                su -c "$IPFS_COMMAND bootstrap add /ip4/${address}/tcp/${IPFS_PORT}/ipfs/${ipfs_peer_id}" - $MY_USERNAME
118
+                su -c "$IPFS_COMMAND bootstrap add /ip6/${address}/tcp/${IPFS_PORT}/ipfs/${ipfs_peer_id}" - $MY_USERNAME
118
                 if [ -d /home/$MY_USERNAME/Desktop ]; then
119
                 if [ -d /home/$MY_USERNAME/Desktop ]; then
119
                     if [[ $ipfs_tox_id != 'none' ]]; then
120
                     if [[ $ipfs_tox_id != 'none' ]]; then
120
                         echo "$ipfs_tox_id:$ipfs_peer_id" >> ${IPFS_USERS_FILE}.new
121
                         echo "$ipfs_tox_id:$ipfs_peer_id" >> ${IPFS_USERS_FILE}.new