Browse Source

publish ssh port to /x/ssh-$UIDNA

pull/6/head
qo-op 11 months ago
parent
commit
fd33ffa000
  1. 16
      zen/ipfs_OPEN_ports.sh

16
zen/ipfs_OPEN_ports.sh

@ -18,20 +18,10 @@ WHOAMI=$(sbotc whoami | jq -r .id) || er+=" sbotc whoami problem"
# Arrange local port forwarded to swarm
# GET _uidna (means g1sms/init.sh been run)
[[ -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna ]] && UIDNA=$(cat /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna)
[[ -f /home/$YOU/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ]] && UIDNA=$(cat /home/$YOU/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid)
if [[ $(which gammu) ]]; then
# I am a g1sms NODE, pushing my web interface
ipfs p2p listen /x/g1sms /ip4/127.0.0.1/tcp/10099
else
# Looking for g1sms NODE in my swarm
SMSNODE=$(ls /home/$YOU/.zen/ipfs_swarm/.12D3KooW*/G1SSB/_g1sms | shuf -n 1 | cut -d '/' -f 6 | cut -d '.' -f 2)
sleep $((1 + RANDOM % 10)) # Wait for DHT to propagate.... Then forward /x/g1sms
[[ $SMSNODE ]] && ipfs p2p forward /x/g1sms /ip4/127.0.0.1/tcp/10097 /p2p/$SMSNODE
fi
# ipfs p2p close --all
# ipfs p2p listen /x/ssh-$UIDNA /ip4/127.0.0.1/tcp/22
ipfs p2p close --all
ipfs p2p listen /x/ssh-$UIDNA /ip4/127.0.0.1/tcp/22
# ipfs p2p listen /x/http-$UIDNA /ip4/127.0.0.1/tcp/80
# ipfs p2p listen /x/https-$UIDNA /ip4/127.0.0.1/tcp/443
ipfs p2p ls

Loading…
Cancel
Save