REPLACE myIP in http response template

This commit is contained in:
fred 2022-10-07 00:56:37 +02:00
parent 49e3bbe133
commit 94fba02bd2
1 changed files with 4 additions and 1 deletions

View File

@ -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//[=&]/ })