From 1ebb9f17eed7b460533f529c50da285ed19791b9 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 4 Sep 2021 20:37:26 +0200 Subject: [PATCH] ## THIS PORT FORWARDING HUB COULD BE MADE MORE CONTROLABLE USING FRIENDSHIP LEVEL & IPFS BALISES --- zen/ipfs_P2P_forward.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zen/ipfs_P2P_forward.sh b/zen/ipfs_P2P_forward.sh index 1d5d9f8..1233ff2 100755 --- a/zen/ipfs_P2P_forward.sh +++ b/zen/ipfs_P2P_forward.sh @@ -67,3 +67,14 @@ fi ipfs p2p ls + +## CONNECT WITH COMMAND +## ipfs cat /ipns/$IPFSNODEID/.$IPFSNODEID/x_ssh-$zuid.sh | bash +if [[ ! -f ~/.zen/ipfs/.$IPFSNODEID/x_ssh-$zuid.sh ]]; then + echo "PORT=$1; [[ ! $PORT ]] && echo 'PORT LOCAL pour ssh-$zuid ?'; read PORT" + echo "[[ ! $(ipfs p2p ls | grep '/x/ssh-$zuid') ]] && ipfs --timeout=5s ping -n 1 /p2p/$IPFSNODEID && ipfs p2p forward /x/ssh-$zuid /ip4/127.0.0.1/tcp/$PORT/p2p/$IPFSNODEID" > ~/.zen/ipfs/.$IPFSNODEID/x_ssh-$zuid.sh + echo "ssh $YOU@127.0.0.1 -p $PORT" >> ~/.zen/ipfs/.$IPFSNODEID/x_ssh-$zuid.sh +fi + +## THIS PORT FORWARDING HUB COULD BE MADE MORE CONTROLABLE USING FRIENDSHIP LEVEL & IPFS BALISES +