From 2e0e8af73d8866eb67612eabb329e24fa9bc15e0 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 21 Oct 2022 18:05:44 +0200 Subject: [PATCH] PORT 1234 has HOMEPAGE NOW --- 12345.sh | 12 ++++++++++-- templates/index.http | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/12345.sh b/12345.sh index 369fe604..8ec44ab1 100755 --- a/12345.sh +++ b/12345.sh @@ -30,11 +30,16 @@ echo "Register and Connect Astronaut with http://$myIP:1234/?email=&ph1=&ph2=" function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } PORT=12345 +HOMEPAGE="$HOME/.zen/Astroport.ONE/templates/instascan.html" while true; do - # REPLACE myIP in http response template - sed "s~127.0.0.1:12345~$myIP:$PORT~g" $HOME/.zen/Astroport.ONE/templates/index.http > ~/.zen/tmp/myIP.http.${MOATS} + if [[ $HOMEPAGE ]]; then + cp $HOMEPAGE $HOME/.zen/tmp/myIP.http.${MOATS} + else + # REPLACE myIP in http response template + sed "s~127.0.0.1:12345~$myIP:$PORT~g" $HOME/.zen/Astroport.ONE/templates/index.http > ~/.zen/tmp/myIP.http.${MOATS} + fi ## LAUNCHING URL=$(cat $HOME/.zen/tmp/myIP.http.${MOATS} | nc -l -p 1234 -q 1 | grep '^GET' | cut -d ' ' -f2 | cut -d '?' -f2) @@ -180,6 +185,9 @@ while [[ ! -f ~/.zen/tmp/index.redirect.${MOATS} && ! $(ps auxf --sort=+utime | ## CHANGE NEXT PORT (HERE YOU CREATE A SOCKET QUEUE) [ $PORT -lt 12399 ] && PORT=$((PORT+1)) || PORT=12345 + ## TODO : RANDOM PORT SWAPPINESS + + HOMEPAGE="" done exit 0 diff --git a/templates/index.http b/templates/index.http index f39760c6..ae0a1c67 100644 --- a/templates/index.http +++ b/templates/index.http @@ -9,7 +9,7 @@ Content-Type: text/html; charset=UTF-8

ASTROPORT

-

Astronaute nous recherchons votre TW ....

+

Astronaute nous créons votre TW ....