Switch ipv4 to ipv6 when creating ipfs boostraps

This commit is contained in:
Bob Mottram 2018-01-18 17:29:03 +00:00
parent 8188fbea23
commit 3712ca79a7
1 changed files with 2 additions and 1 deletions

View File

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