astroport/zen/cron_IPFS_port_forward.sh

20 lines
893 B
Bash
Executable File

#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
# Activate SUPPORT MODE: open ssh over IPFS
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
if [[ -f $MY_PATH/.install/.GPATH ]]; then source $MY_PATH/.install/.GPATH; fi
if [[ -f $MY_PATH/../.install/.GPATH ]]; then source $MY_PATH/../.install/.GPATH; fi
IPFSNODEID=$(ipfs id -f='<id>\n')
su $YOU -c "ipfs p2p close --all"
su $YOU -c "ipfs p2p listen /x/ssh /ip4/127.0.0.1/tcp/22"
su $YOU -c "ipfs p2p listen /x/http /ip4/127.0.0.1/tcp/80"
su $YOU -c "ipfs p2p listen /x/https /ip4/127.0.0.1/tcp/443"
su $YOU -c "ipfs p2p ls"