From 431f01adcd8fa2d0e7b40442c1ac034099de5c04 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 26 Oct 2022 14:55:33 +0200 Subject: [PATCH] $IPFSNODEID --- 12345.sh | 1 + start.sh | 5 ++--- templates/homepage.html | 2 +- templates/index.redirect | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/12345.sh b/12345.sh index 973e2285..047081de 100755 --- a/12345.sh +++ b/12345.sh @@ -63,6 +63,7 @@ Server: Astroport Content-Type: text/html; charset=UTF-8 " > ~/.zen/tmp/123/${MOATS}.index.redirect sed "s~127.0.0.1~$myIP~g" $HOME/.zen/Astroport.ONE/templates/homepage.html >> ~/.zen/tmp/123/${MOATS}.index.redirect +sed -i "s~_IPFSNODEID_~$IPFSNODEID~g" ~/.zen/tmp/123/${MOATS}.index.redirect cat ~/.zen/tmp/123/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 & diff --git a/start.sh b/start.sh index 756325b2..d0c490a2 100755 --- a/start.sh +++ b/start.sh @@ -12,8 +12,7 @@ ME="${0##*/}" TS=$(date -u +%s%N | cut -b1-13) MOATS=$(date -u +"%Y%m%d%H%M%S%4N") -killall 12345.sh -killall nc +killall 12345.sh; killall nc echo ' _ ____ _____ ____ ___ ____ ___ ____ _____ ___ _ _ _____ @@ -36,7 +35,7 @@ YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail [[ ! $YOU ]] && echo "Lancez 'ipfs daemon' SVP sudo systemctl start ipfs" && exit 1 IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) -echo "LAUNCHING 1234 PORT REDIRECTING SPIDER http://myIP:1234" +echo "LAUNCHING 1234 PORT REDIRECTING SPIDER http://$myIP:1234" ~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log & ## CREATE AND OR CONNECT USER diff --git a/templates/homepage.html b/templates/homepage.html index 113ab9fd..4247610d 100644 --- a/templates/homepage.html +++ b/templates/homepage.html @@ -2,7 +2,7 @@ - [Astroport] Système de Fichier Interplanétaire - Terraformation Forêt Jardin + [Astroport] Système de Fichier Interplanétaire - Station _IPFSNODEID_ diff --git a/templates/index.redirect b/templates/index.redirect index 2facd6e3..78a6e691 100644 --- a/templates/index.redirect +++ b/templates/index.redirect @@ -5,6 +5,8 @@ Content-Type: text/html; charset=UTF-8 + [Astroport] Redirecting ... Please refresh if failed +