publish ssh port to /x/ssh-$UIDNA

This commit is contained in:
qo-op 2020-12-28 23:21:01 +01:00
parent 0a09a310a3
commit fd33ffa000
1 changed files with 3 additions and 13 deletions

View File

@ -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