From 94fba02bd2200a85362178d481ca452858d5bdbe Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 7 Oct 2022 00:56:37 +0200 Subject: [PATCH] REPLACE myIP in http response template --- 12345.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/12345.sh b/12345.sh index 378dcc70..ab795a7e 100755 --- a/12345.sh +++ b/12345.sh @@ -31,7 +31,10 @@ function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } while true; do - URL=$(cat $HOME/.zen/Astroport.ONE/templates/index.http | nc -l -p 1234 -q 1 | grep '^GET' | cut -d ' ' -f2 | cut -d '?' -f2) + # REPLACE myIP in http response template + sed "s~127.0.0.1~$myIP~g" $HOME/.zen/Astroport.ONE/templates/index.http > ~/.zen/tmp/myIP.http + + URL=$(cat $HOME/.zen/tmp/myIP.http | nc -l -p 1234 -q 1 | grep '^GET' | cut -d ' ' -f2 | cut -d '?' -f2) echo "==================================================" echo "GET RECEPTION : $URL" arr=(${URL//[=&]/ })