_index.html App

This commit is contained in:
fred 2023-12-04 16:45:54 +01:00
parent 839974abc1
commit 4bc73417fc
3 changed files with 17 additions and 5 deletions

View File

@ -58,12 +58,27 @@ LAT=${THIS}
LON=${WHAT}
[[ -z $LON ]] && LON=0.00
function makecoord() {
local input="$1"
if [[ ${input} =~ ^-?[0-9]+\.[0-9]$ ]]; then
input="${input}0"
elif [[ ${input} =~ ^-?[0-9]+$ ]]; then
input="${input}.00"
fi
echo "${input}"
}
# PREPARE HTTP RESPONSE (application/json)
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http
if [[ $DEG == "0.001" ]]; then
LAT=$(makecoord $LAT)
LON=$(makecoord $LON)
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
ipfs key rm ${G1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
@ -73,7 +88,7 @@ if [[ $DEG == "0.001" ]]; then
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
rm -Rf ~/.zen/tmp/${MOATS}/
end=`date +%s`
echo "(EXPLORE ZONE $DEG) Operation time was "`expr $end - $start` seconds.
echo "(EXPLORE ZONE $DEG)_${LAT}_${LON} $UMAPNS Operation time was "`expr $end - $start` seconds.
exit 0
fi

View File

@ -223,9 +223,6 @@ for SECTOR in ${SECTORS[@]}; do
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html
## Make it root App for SECTORNS key
mv ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html \
~/.zen/tmp/${MOATS}/${SECTOR}/index.html
##################################
###########################################################################################

View File

@ -315,7 +315,7 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />" > ~/.z
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${UMAPNS}~g" \
-e "s~_UPZONENS_~${SECTORNS}~g" \
-e "s~_UPZONENS_~${SECTORNS}/TW~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.html