mieux
This commit is contained in:
parent
c99d25ce36
commit
13c839b3ea
|
@ -69,13 +69,15 @@ echo
|
||||||
PORT=22000
|
PORT=22000
|
||||||
PORT=$((PORT+${RANDOM:0:3}))
|
PORT=$((PORT+${RANDOM:0:3}))
|
||||||
|
|
||||||
echo "#!/bin/bash
|
echo '#!/bin/bash
|
||||||
if [[ ! \$(ipfs p2p ls | grep x/ssh-${IPFSNODEID}) ]]; then
|
if [[ ! $(ipfs p2p ls | grep x/ssh-'${IPFSNODEID}') ]]; then
|
||||||
ipfs --timeout=10s ping -n 3 /p2p/${IPFSNODEID}
|
ipfs --timeout=10s ping -n 4 /p2p/'${IPFSNODEID}'
|
||||||
ipfs p2p forward /x/ssh-${IPFSNODEID} /ip4/127.0.0.1/tcp/$PORT /p2p/${IPFSNODEID}
|
[[ $? == 0 ]] \
|
||||||
|
&& ipfs p2p forward /x/ssh-'${IPFSNODEID}' /ip4/127.0.0.1/tcp/'${PORT}' /p2p/'${IPFSNODEID}' \
|
||||||
|
&& ssh '${USER}'@127.0.0.1 -p '${PORT}'
|
||||||
|
|| echo "CONTACT IPFSNODEID FAILED - ERROR -"
|
||||||
fi
|
fi
|
||||||
ssh ${USER}@127.0.0.1 -p $PORT
|
' > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
|
||||||
" > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
|
|
||||||
|
|
||||||
cat ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
|
cat ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue