forked from STI/Astroport.ONE
_index.html App
This commit is contained in:
parent
839974abc1
commit
4bc73417fc
17
API/ZONE.sh
17
API/ZONE.sh
|
@ -58,12 +58,27 @@ LAT=${THIS}
|
||||||
LON=${WHAT}
|
LON=${WHAT}
|
||||||
[[ -z $LON ]] && LON=0.00
|
[[ -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)
|
# PREPARE HTTP RESPONSE (application/json)
|
||||||
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
|
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
|
||||||
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http
|
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http
|
||||||
|
|
||||||
if [[ $DEG == "0.001" ]]; then
|
if [[ $DEG == "0.001" ]]; then
|
||||||
|
|
||||||
|
LAT=$(makecoord $LAT)
|
||||||
|
LON=$(makecoord $LON)
|
||||||
|
|
||||||
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${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}"
|
${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
|
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 &
|
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
|
||||||
rm -Rf ~/.zen/tmp/${MOATS}/
|
rm -Rf ~/.zen/tmp/${MOATS}/
|
||||||
end=`date +%s`
|
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
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -223,9 +223,6 @@ for SECTOR in ${SECTORS[@]}; do
|
||||||
-e "s~http://127.0.0.1:8080~~g" \
|
-e "s~http://127.0.0.1:8080~~g" \
|
||||||
> ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html
|
> ~/.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
|
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
|
|
|
@ -315,7 +315,7 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />" > ~/.z
|
||||||
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
|
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
|
||||||
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
|
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
|
||||||
-e "s~_ZONENS_~${UMAPNS}~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" \
|
-e "s~http://127.0.0.1:8080~~g" \
|
||||||
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.html
|
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.html
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue