coucou only for COINS and not served PORT

This commit is contained in:
fred 2023-10-17 21:30:38 +02:00
parent 699e51a576
commit 9aadaa4e55
2 changed files with 10 additions and 10 deletions

View File

@ -88,24 +88,24 @@ while true; do
############### ############### ############### ############### templates/index.http
# REPLACE myHOST in http response template (fixing next API meeting point)
echo "$HTTPCORS" > ~/.zen/tmp/coucou/${MOATS}.myHOST.http
myHtml >> ~/.zen/tmp/coucou/${MOATS}.myHOST.http
echo "$HTTPCORS" > ~/.zen/tmp/coucou/${PORT}.myHOST.http
myHtml >> ~/.zen/tmp/coucou/${PORT}.myHOST.http
## REPLACE RESPONSE PORT
sed -i -e "s~http://127.0.0.1:12345~http://${myIP}:${PORT}~g" \
~/.zen/tmp/coucou/${MOATS}.myHOST.http
~/.zen/tmp/coucou/${PORT}.myHOST.http
## WAN REDIRECT TO HTTPS:// + /${PORT}
[ -z "$isLAN" ] \
&& sed -i -e "s~http://${myIP}:${PORT}~${myASTROPORT}/${PORT}~g" ~/.zen/tmp/coucou/${MOATS}.myHOST.http
&& sed -i -e "s~http://${myIP}:${PORT}~${myASTROPORT}/${PORT}~g" ~/.zen/tmp/coucou/${PORT}.myHOST.http
## UPLANET HOME LINK REPLACEMENT
sed -i -e "s~https://ipfs.copylaradio.com/ipns/copylaradio.com~${myUPLANET}~g" ~/.zen/tmp/coucou/${MOATS}.myHOST.http
sed -i -e "s~https://ipfs.copylaradio.com/ipns/copylaradio.com~${myUPLANET}~g" ~/.zen/tmp/coucou/${PORT}.myHOST.http
############################################################################
## SERVE LANDING REDIRECT PAGE ~/.zen/tmp/coucou/${MOATS}.myHOST.http on PORT 1234 (LOOP BLOCKING POINT)
## SERVE LANDING REDIRECT PAGE ~/.zen/tmp/coucou/${PORT}.myHOST.http on PORT 1234 (LOOP BLOCKING POINT)
############################################################################
REQ=$(cat $HOME/.zen/tmp/coucou/${MOATS}.myHOST.http | nc -l -p 1234 -q 1 && rm $HOME/.zen/tmp/coucou/${MOATS}.myHOST.http) ## # WAIT FOR 1234 PORT CONTACT
REQ=$(cat $HOME/.zen/tmp/coucou/${PORT}.myHOST.http | nc -l -p 1234 -q 1 && rm $HOME/.zen/tmp/coucou/${PORT}.myHOST.http) ## # WAIT FOR 1234 PORT CONTACT
URL=$(echo "$REQ" | grep '^GET' | cut -d ' ' -f2 | cut -d '?' -f2)
HOSTP=$(echo "$REQ" | grep '^Host:' | cut -d ' ' -f2 | cut -d '?' -f2)

View File

@ -155,8 +155,8 @@ if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
if [ $? == 0 ]; then
## TODO : MEMORIZE TX TO VERIFY ASTRO/DUNITER SYNC
COINSFILE="$HOME/.zen/tmp/coucou/${G1PUB}.COINS"
DESTFILE="$HOME/.zen/tmp/coucou/${VAL}.COINS"
COINSFILE="$HOME/.zen/tmp/${MOATS}/${G1PUB}.COINS"
DESTFILE="$HOME/.zen/tmp/${MOATS}/${VAL}.COINS"
CUR=$(cat ${COINSFILE})
[[ ${CUR} != "" && ${CUR} != "null" ]] \
@ -624,7 +624,7 @@ echo ">>> ${QRCODE} g1_to_ipfs $ASTROTOIPFS"
## GET VISITOR G1 WALLET AMOUNT : VISITORCOINS
echo "COINScheck : ${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${QRCODE}"
VISITORCOINS=$(${MY_PATH}/../tools/COINScheck.sh ${QRCODE} | tail -n 1)
COINSFILE=$HOME/.zen/tmp/coucou/${QRCODE}.COINS
COINSFILE=$HOME/.zen/tmp/${MOATS}/${QRCODE}.COINS
### PATCH COPY G1BILLET G1PUB TO MALKE PAYMENT WHEN RECONNECT
cp $COINSFILE ~/live/