Merge branch 'papiche:master' into master

This commit is contained in:
Haaze9 2024-02-19 13:41:37 +01:00 committed by GitHub
commit 45d7dfff71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
108 changed files with 2096 additions and 785 deletions

View File

@ -15,7 +15,9 @@ LOWMODE=$(sudo systemctl status ipfs | grep disabled) ## IPFS DISABLED - START O
[[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]] && LOWMODE="NO 5001" ## IPFS IS STOPPED
[[ ! $isLAN ]] && LOWMODE="" ## LOWMODE ONLY FOR LAN STATION
# echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
sudo systemctl restart ipfs && sleep 10
floop=0
while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do
sleep 10
@ -24,9 +26,14 @@ while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do
&& ${MY_PATH}/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "IPFS RESTART ERROR 20H12" \
&& exit 1
done
# espeak "CODE git pull" > /dev/null 2>&1
## REMOVE TMP BUT KEEP SWARM
## PING BOOSTRAP & SWARM NODES
${MY_PATH}/ping_bootstrap.sh
# show ZONE.sh cache of the day
ls ~/.zen/tmp/ZONE_*
## REMOVE TMP BUT KEEP SWARM and coucou
mv ~/.zen/tmp/swarm ~/.zen/swarm
mv ~/.zen/tmp/coucou ~/.zen/coucou
rm -Rf ~/.zen/tmp/*
@ -39,7 +46,7 @@ mv ~/.zen/coucou ~/.zen/tmp/coucou
&& rm -Rf ~/.zen/G1BILLET/tmp/*
## UPDATE Astroport.ONE code
cd ~/.zen/Astroport.ONE/
cd ${MY_PATH}/
git pull
## SOON /ipns/ Address !!!
@ -49,26 +56,32 @@ git pull
${MY_PATH}/youtube-dl.sh
sudo youtube-dl -U
# Refresh ~/.zen/game/world/G1VOEU
# NOW RUN FROM PLAYER.refresh.sh !! ~/.zen/Astroport.ONE/RUNTIME/VOEUX.refresh.sh
## PING BOOSTRAP & SWARM NODES
${MY_PATH}/ping_bootstrap.sh
#####################################
# espeak "Players refresh" > /dev/null 2>&1
# Refresh ~/.zen/game/players/PLAYER
~/.zen/Astroport.ONE/RUNTIME/PLAYER.refresh.sh
#####################################
${MY_PATH}/RUNTIME/PLAYER.refresh.sh
#####################################
#####################################
# espeak "REFRESHING UPLANET" > /dev/null 2>&1
~/.zen/Astroport.ONE/RUNTIME/UPLANET.refresh.sh
#####################################
${MY_PATH}/RUNTIME/UPLANET.refresh.sh
#####################################
#####################################
# espeak "REFRESHING NODE" > /dev/null 2>&1
~/.zen/Astroport.ONE/RUNTIME/NODE.refresh.sh
#####################################
${MY_PATH}/RUNTIME/NODE.refresh.sh
#####################################
## if [[ ! $isLAN ]]; then
## REFRESH BOOSTRAP LIST (OFFICIAL SWARM)
espeak "bootstrap refresh" > /dev/null 2>&1
ipfs bootstrap rm --all > /dev/null 2>&1
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
for bootnode in $(cat ${MY_PATH}/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
do
ipfsnodeid=${bootnode##*/}
ipfs bootstrap add $bootnode
@ -87,7 +100,7 @@ echo "20H12 (♥‿‿♥) Execution time was $dur seconds."
## DRAGON SSH WOT
echo "STOP DRAGONS WOT"
${MY_PATH}/tools/DRAGON_p2p_ssh.sh off
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh off
## RESTART
## MAIL LOG : support@qo-op.com ##
@ -101,9 +114,9 @@ espeak "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds" > /dev/nu
## KILL ALL REMAINING nc
killall nc 12345.sh > /dev/null 2>&1
## OPEN API ENGINE
## SYSTEMD OR NOT SYSTEMD
if [[ ! -f /etc/systemd/system/astroport.service ]]; then
~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log &
${MY_PATH}/12345.sh > ~/.zen/tmp/12345.log &
PID=$!
echo $PID > ~/.zen/.pid
else
@ -113,18 +126,23 @@ else
fi
echo "IPFS LOW MODE ?"
echo "IPFS DAEMON LEVEL"
######### IPFS DAMEON NOT RUNNING ALL DAY
## IF IPFS DAEMON DISABLED : WAIT 1H & STOP IT
[[ $LOWMODE != "" ]] \
&& echo "ON. $LOWMODE" \
&& sleep 360 \
&& echo "STOP IPFS $LOWMODE" \
&& sleep 3600 \
&& sudo systemctl stop ipfs \
&& exit 0
echo "OFF. RESTART IPFS"
echo "HIGH. RESTART IPFS"
sleep 60
sudo systemctl restart ipfs
#################################
### DRAGON WOT : SSH P2P RING OPENING
#################################
sleep 30
${MY_PATH}/tools/DRAGON_p2p_ssh.sh
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh
exit 0

View File

@ -167,15 +167,14 @@ echo "UMAPNS : ${myIPFS}/ipns/${UMAPNS}"
## ALL TEST PASSED -> CREATE ZENCARD + ASTROID
NPASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-9) ## NOUVEAU PASS 8 CHIFFRES
PPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 2) ## STRONGER TW SECURITY "AlpH4nUm"
DPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 2) ## STRONGER TW SECURITY "AlpH4nUm"
PPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 4) ## STRONGER TW SECURITY "AlpH4nUm"
NPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 10) ## STRONGER TW SECURITY "AlpH4nUm"
## CREATE ASTRONAUTE TW ON CURRENT ASTROPORT
(
echo VISA.new.sh "${EMAIL}_${PPASS}_${DPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}"
echo VISA.new.sh "${EMAIL}_${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}"
##### (☉_☉ ) #######
${MY_PATH}/../RUNTIME/VISA.new.sh "${EMAIL}_${PPASS}_${DPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
${MY_PATH}/../RUNTIME/VISA.new.sh "${EMAIL}_${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
## TO REMOVE : MONITOR
${MY_PATH}/../tools/mailjet.sh "support@qo-op.com" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt "LOG VISA.new $EMAIL" ## Send VISA.new log to EMAIL
@ -187,7 +186,7 @@ echo "(TW REGISTRATION) Operation time was "`expr $end - $start` seconds.
########################################
## Calculating TW IPNS ADDRESS
TWADD=$(${MY_PATH}/../tools/keygen -t ipfs "${EMAIL}_${PPASS}_${DPASS}" "${NPASS}")
TWADD=$(${MY_PATH}/../tools/keygen -t ipfs "${EMAIL}_${PPASS}" "${NPASS}")
## HTTP nc ON PORT RESPONSE
echo "$HTTPCORS
@ -219,7 +218,7 @@ echo "$HTTPCORS
<h1>UPlanet Registration</h1>
Your AstroID seeds are:<br>
<br>
<h2>${EMAIL}_${PPASS}_${DPASS}</h2>
<h2>${EMAIL}_${PPASS}</h2>
<h1>${NPASS}</h1>
Generating account...

View File

@ -7,8 +7,7 @@
## API: ZONE
## Used by OSM2IPFS map_render.html & other UPlanet Client App
# ?zone=DEG&ulat=LAT&ulon=LON
## Search for TW numbers in received zone
# = json
## Search for TW numbers in received zone # >> return json
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
@ -42,103 +41,134 @@ function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
## RUNNING UPLANET LAT/LON TW DETECTION
mkdir -p ~/.zen/tmp/${MOATS}/
# GET RECEPTION : zone=0.001&ulat=0.02&ulon=0.01
DEG=${THAT}
[[ -z $DEG ]] && DEG=1
# DEG=$(echo "$DEG * 10" | bc -l )
LAT=${THIS}
[[ -z $LAT ]] && LAT=0.00
LON=${WHAT}
[[ -z $LON ]] && LON=0.00
# PREPARE HTTP RESPONSE (application/json)
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http
LAT=$(makecoord $LAT)
LON=$(makecoord $LON)
# ------------------------------------------------------------------- #
# GET/?zone=0.001&ulat=0.02&ulon=0.01
# ------------------------------------------------------------------- #
echo "REQUEST $LAT / $LON / $DEG"
DEG="${THAT}"
[[ -z ${DEG} ]] && DEG=1
# DEG=$(echo "${DEG} * 10" | bc -l )
## REGION & ABOVE LEVEL
if [[ $DEG == "0.1" || $DEG == "1" ]]; then
LAT=$(echo ${LAT} | cut -d '.' -f 1)
LON=$(echo ${LON} | cut -d '.' -f 1)
ZONE="_${LAT}_${LON}"
echo "ZONE = ${ZONE}"
ZONEG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${ZONE}" "${UPLANETNAME}${ZONE}")
ZONETW="/ipns/"$(${MY_PATH}/../tools/keygen -t ipfs "${YESTERDATE}${UPLANETNAME}${ZONE}" "${YESTERDATE}${UPLANETNAME}${ZONE}")
LAT="${THIS}"
[[ -z $LAT ]] && LAT=0.00
LON="${WHAT}"
[[ -z $LON ]] && LON=0.00
LAT=$(makecoord ${LAT})
LON=$(makecoord ${LON})
JSON="ZONE_${LAT}_${LON}_${DEG}.json"
[[ $(date +"%H%M") -gt 2012 ]] \
&& THEDATE=${TODATE} \
|| THEDATE=${YESTERDATE}
echo "${THEDATE}"
## SECTOR LEVEL
if [[ ${DEG} == "0.01" ]]; then
SECLAT="${LAT::-1}"
SECLON="${LON::-1}"
SECTOR="_${SECLAT}_${SECLON}"
echo "SECTOR = ${SECTOR}"
ZONEG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}")
ZONEINDEX="/ipns/"$(${MY_PATH}/../tools/keygen -t ipfs "${THEDATE}${UPLANETNAME}${SECTOR}" "${THEDATE}${UPLANETNAME}${SECTOR}")"/_index.html"
JSON="ZONE${SECTOR}_${DEG}.json"
fi
## REGION & ABOVE LEVEL
if [[ ${DEG} == "0.1" || ${DEG} == "1" ]]; then
LAT=$(echo ${LAT} | cut -d '.' -f 1)
LON=$(echo ${LON} | cut -d '.' -f 1)
ZONE="_${LAT}_${LON}"
echo "ZONE = ${ZONE}"
ZONEG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${ZONE}" "${UPLANETNAME}${ZONE}")
ZONEINDEX="/ipns/"$(${MY_PATH}/../tools/keygen -t ipfs "${THEDATE}${UPLANETNAME}${ZONE}" "${THEDATE}${UPLANETNAME}${ZONE}")
JSON="ZONE${ZONE}_${DEG}.json"
fi
echo " JSON = ${JSON}"
if [[ ! -s ~/.zen/tmp/${JSON} ]]; then
## UMAP LEVEL
if [[ ${DEG} == "0.001" ]]; then
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
echo " ## UMAP _${LAT}*_${LON}* = ${totnum} PLAYERs"
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${THEDATE}${UPLANETNAME}${LAT}" "${THEDATE}${UPLANETNAME}${LON}"
ipfs key rm ${G1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo '{ "gridNumbers": [ {"lat": '${LAT}', "lon": '${LON}', "number": "(_'${LAT}'_'${LON}') = '${totnum}'", "ipns": "'${myIPFS}/ipns/${UMAPNS}/_index.html'" } ] }' \
> ~/.zen/tmp/${MOATS}.http.grid
cp ~/.zen/tmp/${MOATS}.http.grid ~/.zen/tmp/${JSON}
cat ~/.zen/tmp/${JSON} >> ~/.zen/tmp/${MOATS}.http
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
rm -Rf ~/.zen/tmp/${MOATS}/
end=`date +%s`
echo "(UMAP)_${LAT}_${LON} ${THEDATE} $UMAPNS Operation time was "`expr $end - $start` seconds.
exit 0
fi
##############################################
## SEARCH FOR UPLANET TW NUMBERS IN THAT ZONE
echo '{ "gridNumbers": [' >> ~/.zen/tmp/${MOATS}.http.grid
for i in $(seq 0 9);
do
ZLAT=$(echo "$LAT + ${DEG} * $i" | bc -l )
[[ -z ${ZLAT} ]] && ZLAT=0
# [[ ! $(echo $ZLAT | grep "\." ) ]] && ZLAT="${ZLAT}."
for j in $(seq 0 9); do
ZLON=$(echo "$LON + ${DEG} * $j" | bc -l )
[[ -z ${ZLON} ]] && ZLON=0
# [[ ! $(echo $ZLON | grep "\." ) ]] && ZLON="${ZLON}."
echo " ## SEARCH UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*"
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
[[ $totnum -gt 9 ]] && displaynum="X" || displaynum=$totnum
[[ $displaynum != "0" ]] && echo '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${displaynum}'", "ipns": "'${ZONEINDEX}'" }
,' >> ~/.zen/tmp/${MOATS}.http.grid \
&& echo "${DEG} :" '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${totnum}'", "ipns": "'${ZONEINDEX}'" }'
done
done
sed -i '$ d' ~/.zen/tmp/${MOATS}.http.grid ## REMOVE LAST ','
echo ']}' >> ~/.zen/tmp/${MOATS}.http.grid
echo "## ADD TO CACHE ~/.zen/tmp/${JSON}"
cp ~/.zen/tmp/${MOATS}.http.grid ~/.zen/tmp/${JSON}
fi
## SECTOR LEVEL
if [[ $DEG == "0.01" ]]; then
SECLAT="${LAT::-1}"
SECLON="${LON::-1}"
SECTOR="_${SECLAT}_${SECLON}"
echo "SECTOR = ${SECTOR}"
ZONEG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}")
ZONETW="/ipns/"$(${MY_PATH}/../tools/keygen -t ipfs "${YESTERDATE}${UPLANETNAME}${SECTOR}" "${YESTERDATE}${UPLANETNAME}${SECTOR}")
fi
## UMAP LEVEL
if [[ $DEG == "0.001" ]]; then
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
echo " ## UMAP _${LAT}*_${LON}* = ${totnum} PLAYERs"
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${UPLANETNAME}${LON}"
ipfs key rm ${G1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo '{ "gridNumbers": [ {"lat": '${LAT}', "lon": '${LON}', "number": "(_'${LAT}'_'${LON}') = '${totnum}'", "ipns": "'${myIPFS}/ipns/${UMAPNS}/_index.html'" } ] }' >> ~/.zen/tmp/${MOATS}.http
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
rm -Rf ~/.zen/tmp/${MOATS}/
end=`date +%s`
echo "(UMAP)_${LAT}_${LON} ${YESTERDATE} $UMAPNS Operation time was "`expr $end - $start` seconds.
exit 0
fi
## ALL OTHER DEG : SEARCH FOR UPLANET TW NUMBERS
echo '{ "gridNumbers": [' >> ~/.zen/tmp/${MOATS}.http
for i in $(seq 0 9);
do
ZLAT=$(echo "$LAT + $DEG * $i" | bc -l )
[[ -z ${ZLAT} ]] && ZLAT=0
# [[ ! $(echo $ZLAT | grep "\." ) ]] && ZLAT="${ZLAT}."
for j in $(seq 0 9); do
ZLON=$(echo "$LON + $DEG * $j" | bc -l )
[[ -z ${ZLON} ]] && ZLON=0
# [[ ! $(echo $ZLON | grep "\." ) ]] && ZLON="${ZLON}."
echo " ## SEARCH UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*"
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
[[ $totnum -gt 9 ]] && displaynum="X" || displaynum=$totnum
[[ $displaynum != "0" ]] && echo '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${displaynum}'", "ipns": "'${ZONETW}'" }
,' >> ~/.zen/tmp/${MOATS}.http && echo "$DEG :" '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${totnum}'", "ipns": "'${ZONETW}'" }'
done
done
sed -i '$ d' ~/.zen/tmp/${MOATS}.http ## REMOVE LAST ','
echo ']}' >> ~/.zen/tmp/${MOATS}.http
### SEND RESPONSE ON PORT
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
cat ~/.zen/tmp/${JSON} >> ~/.zen/tmp/${MOATS}.http
(
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
rm ~/.zen/tmp/${MOATS}.http.grid 2>/dev/null
rm ~/.zen/tmp/${MOATS}.http && echo "BLURP ${JSON}"
) &
## CLEANING
rm -Rf ~/.zen/tmp/${MOATS}/
## TIMING
end=`date +%s`
echo "(ZONE) Operation time was "`expr $end - $start` seconds.

View File

@ -1,77 +0,0 @@
#!/bin/bash
########################################################################
# Version: 0.5
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# PAD COCODING : https://pad.p2p.legal/s/G1Monit
# KODI SERVICE : Publish and Merge Friends Monit Movies into RSS Stream
########################################################################
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/../tools/my.sh"
echo "$ME RUNNING"
########################################################################
## SCAN FOR PAYMENT HISTORY
## BUILD python NetworkX script
## SEND MESSAGE TO SOURCEG1PUB
########################################################################
## THIS SCRIPT IS RUN WHEN A WALLET RECEIVED A TRANSACTION WITH COMMENT STARTING WITH N1Monit
########################################################################
INDEX="$1"
[[ ! ${INDEX} ]] && INDEX="$HOME/.zen/game/players/.current/ipfs/moa/index.html"
[[ ! -s ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
PLAYER="$2"
[[ ! ${PLAYER} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! ${ASTRONAUTENS} ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
# Extract tag=tube from TW
MOATS="$3"
[[ ! ${MOATS} ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
IPUBKEY="$4"
[[ ! ${IPUBKEY} ]] && echo "ERROR - MISSING COMMAND ISSUER !" && exit 1
TH="$5"
[[ ! ${TH} ]] && echo "ERROR - MISSING COMMAND TITLE HASH ADDRESS !" && exit 1
echo "${PLAYER} : ${IPUBKEY} SEEKING FOR ${TH}
${ASTRONAUTENS} ${G1PUB} "
#~ ###################################################################
#~ ## CREATE APP NODE PLAYER PUBLICATION DIRECTORY
#~ ###################################################################
mkdir -p $HOME/.zen/tmp/${MOATS} && echo $HOME/.zen/tmp/${MOATS}
## EXERCICE ### TODO ###
## USE https://networkx.org/documentation/stable/tutorial.html#
## EXTRACT HISTORY WITH jaklis
## CREATE A PYTHON SCRIPT CREATING the 1st level of TX
echo "import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
...
G.add_node(SRCPUB)
G.add_node(DSTPUB)
G.edges[SRCPUB, DSTPUB]['g1'] = AMOUNT
...
nx.draw(G, with_labels=True, font_weight='bold')
plt.show()
"
## EXTEND N1Script WITH MORE FUNCTIONS... exemples ...
## N1Vote: permet de pratiquer le Vote Quadratique
## N1Conf: permet de signifier la Confiance
## ...
exit 0

View File

@ -60,43 +60,21 @@ At this point, if it exists "ASTROBOT/G1Tag.sh" program will publish the data re
# INSTALLATION (Linux Mint / Ubuntu / DEBIAN)
There is 2 methods one for server and one for Linux Mint desktop
## SERVER : Using DOCKER (and MyOS)
the easiest way to automaticaly deploy and host Astroport.ONE services
```
# install minimal requirements
sudo apt install git docker make
# clone Astroport.ONE repo
git clone https://github.com/papiche/Astroport.ONE.git
cd Astroport.ONE
make
make install
```
If your computer is running 24/24, you can join our "Boostrap list" & officially become a [TW UPlanet hoster](https://talk.tiddlywiki.org/t/uplanet-a-planet-full-of-tws/8193?u=papiche)
> DOCKER MODE NOT READY TO USE !! FOLLOW AND ADAPT NEXT STEP
## DESKTOP : Using install.sh script
Tested on "Linux Mint" (Debian like distro compatible), the **hacker way for using & buidling new blockchain services** ...
```
# install on system wide
# SOURCE GIT.P2P.LEGAL
bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/install.sh)
INSTALL COMMAND
# SOURCE GITHUB
```
bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/install.sh)
```
> PLEASE REPORT ANY ISSUES
> TODO: MORE MODULAR INSTALL.
> CREATE adventure explaining it
## DRAGONS WOT
Once you install Astroport.ONE...
If all has gone well, you should find these processes running...
@ -113,7 +91,12 @@ If all has gone well, you should find these processes running...
```
# LAUNCH
> Become Official REGIONAL Station
> - follow "PGP/SSH/IPFSNODEID" linking procedure -
> https://pad.p2p.legal/keygen
# DESKTOP
After installation, you should have 3 new shortcuts on your desktop
@ -121,6 +104,10 @@ After installation, you should have 3 new shortcuts on your desktop
* REC" allows you to save your files on IPFS and publish their Capusle in your TW.
* G1BILLET" lets you create ZenCards and other useful QRCodes
NB : If you use "Nemo" as file manager. You can "ipfs add" any file (with no space in file name) by right click it.
> TODO : detect OS and FILE MANAGER to adapt desktop linking and right clic action
## How to manage your "Astroport"!
You need to create a "PLAYER".
@ -131,8 +118,9 @@ It is defined by email, salt, pepper, lat, lon and PASS
```
Browse available functions
A Station can host multiple "PLAYER and its TiddlyWiki".
A Station can host multiple "PLAYERs and TiddlyWikis".
---
# "BASH API" : "♥BOX"
## http://astroport.localhost:1234

View File

@ -7,7 +7,7 @@
# Activate SUPPORT MODE: open ssh over IPFS
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "$MY_PATH/my.sh"
. "$MY_PATH/../tools/my.sh"
########################################################################
YOU=$(myIpfsApi) || er+=" ipfs daemon not running"
[[ "$YOU" == "" || "${IPFSNODEID}" == "" ]] && echo "ERROR : $er " && exit 1

View File

@ -12,29 +12,28 @@ ME="${0##*/}"
. "${MY_PATH}/../tools/my.sh"
CESIUM=${myCESIUM}
GCHANGE=${myGCHANGE}
CESIUM=${myCESIUM}
GCHANGE=${myGCHANGE}
echo "(✜‿‿✜) G1PalPay : Receiving & Relaying payments to emails found in comment"
echo "$ME RUNNING"
########################################################################
# PALPAY SERVICE
# PALPAY SERVICE : MONITOR INCOMING TX & NEW TIDDLERS
########################################################################
########################################################################
INDEX="$1"
INDEX="$1" ## TW file
[[ ! ${INDEX} ]] && INDEX="$HOME/.zen/game/players/.current/ipfs/moa/index.html"
[[ ! -s ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
PLAYER="$2"
PLAYER="$2" ## PLAYER
[[ ! ${PLAYER} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1) ## TW /ipns/
[[ ! ${ASTRONAUTENS} ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub) ## PLAYER WALLET
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
# Extract tag=tube from TW
@ -47,23 +46,32 @@ MOATS="$3"
mkdir -p $HOME/.zen/tmp/${IPFSNODEID}/G1PalPay/${PLAYER}/
mkdir -p $HOME/.zen/game/players/${PLAYER}/G1PalPay/
mkdir -p $HOME/.zen/tmp/${MOATS}
echo "=========== ( ◕‿◕) (◕‿◕ ) =============="
echo "=========== ( ◕‿◕) (◕‿◕ ) ============== ${PLAYER}
${INDEX}"
echo "(✜‿‿✜) G1PalPay : CHECK LAST 10 TX comment"
# CHECK LAST 10 INCOMING PAYMENTS
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey history -n 10 -j > $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json
[[ ! -s $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json ]] \
&& echo "NO PAYMENT HISTORY" \
&& echo "NO PAYMENT HISTORY.......................... EXIT" \
&& exit 1
##############################
##########################################################
############# CHECK FOR N1COMMANDs IN PAYMENT COMMENT
# TODO check amout > 0
#################################################################
cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -rc .[]
## TREAT ANY COMMENT STARTING WITH N1:
## EXTRACT /ASTROBOT/N1ProgramNames
ls ${MY_PATH}/../ASTROBOT/ | grep "N1" | cut -d "." -f 1 > ~/.zen/tmp/${MOATS}/N1PROG
## TREAT ANY COMMENT STARTING WITH N1
cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -rc .[] | grep 'N1' > ~/.zen/tmp/${MOATS}/myN1.json
while read prog; do
cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -rc .[] | grep "$prog" >> ~/.zen/tmp/${MOATS}/myN1.json
done < ~/.zen/tmp/${MOATS}/N1PROG
# got N1 incoming TX
while read NLINE; do
## COMMENT FORMAT = N1$CMD:$TH:$TRAIL
TXIDATE=$(echo ${NLINE} | jq -r .date)
@ -72,7 +80,10 @@ while read NLINE; do
COMMENT=$(echo ${NLINE} | jq -r .comment)
CMD=$(echo ${COMMENT} | cut -d ':' -f 1 | cut -c -12 ) # Maximum 12 characters CMD
[[ $(cat ~/.zen/game/players/${PLAYER}/.ndate) -ge $TXIDATE ]] && echo "$CMD $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" && continue
# Verify last recorded acting date (avoid running twice)
[[ $(cat ~/.zen/game/players/${PLAYER}/.ndate) -ge $TXIDATE ]] \
&& echo "$CMD $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" \
&& continue
TH=$(echo ${COMMENT} | cut -d ':' -f 2)
TRAIL=$(echo ${COMMENT} | cut -d ':' -f 3-)
@ -114,7 +125,9 @@ while read LINE; do
COMMENT=$(echo $JSON | jq -r .comment)
echo ">>> TODO CHECK TX HAPPENS LAST 24H (WHAT IS TXIDATE=$TXIDATE FORMAT ??)"
[[ $(cat ~/.zen/game/players/${PLAYER}/.atdate) -ge $TXIDATE ]] && echo "PalPay $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" && continue
[[ $(cat ~/.zen/game/players/${PLAYER}/.atdate) -ge $TXIDATE ]] \
&& echo "PalPay $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" \
&& continue
## GET EMAILS FROM COMMENT
TXIMAILS=($(echo "$COMMENT" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
@ -123,9 +136,11 @@ while read LINE; do
echo "N=${#TXIMAILS[@]}"
N=${#TXIMAILS[@]}
SHARE=$(echo "scale=2; $TXIAMOUNT / $N" | bc)
## SHARE is received AMOUT divided by numbers of EMAILS in comment
echo "$TXIDATE $TXIPUBKEY $TXIAMOUNT [$TXIAMOUNTUD] $TXIMAILS % $SHARE %"
# let's loop over TXIMAILS
for EMAIL in "${TXIMAILS[@]}"; do
[[ ${EMAIL} == $PLAYER ]] && echo "ME MYSELF" && continue
@ -144,8 +159,8 @@ while read LINE; do
[[ ! ${ASTROG1} ]] \
&& echo "<html><body><h1>SORRY ${EMAIL} YOUR ACCOUNT IS MISSING</h1>" \
&& echo " BRO. $PLAYER WISH TO SEND YOU SOME ẐEN <br><br>(♥‿‿♥)... Join <a href='https://qo-op.com'>UPlanet</a> and receive it</body></html>" > ~/.zen/tmp/palpay.bro \
&& ${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/palpay.bro "NEED FOR ACCOUNT" \
&& echo " BRO. $PLAYER WISH TO SEND YOU SOME ẐEN <br><br>(♥‿‿♥)... Join <a href='https://qo-op.com'>UPlanet</a> to receive it</body></html>" > ~/.zen/tmp/palpay.bro \
&& ${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/palpay.bro "MISSING ACCOUNT" \
&& continue
@ -183,22 +198,27 @@ echo "=========== %%%%% (°▃▃°) %%%%%%% =============="
echo "# EXTRACT TODAY TIDDLERS"
tiddlywiki --load ${INDEX} \
--output ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/ \
--render '.' "today.${PLAYER}.tiddlers.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-1]]'
--render '.' "today.${PLAYER}.tiddlers.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-2]]'
## FILTER MY OWN EMAIL
# cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/today.${PLAYER}.tiddlers.json | jq -rc # LOG
cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/today.${PLAYER}.tiddlers.json \
| sed "s~${PLAYER}~ ~g" | jq -rc '.[] | select(.tags | contains("@"))' > ~/.zen/tmp/${MOATS}/@tags.json 2>/dev/null ## REMOVE PLAYER EMAIL IN INLINE JSON
| sed "s~${PLAYER}~ ~g" | jq -rc '.[] | select(.tags | contains("@"))' \
> ~/.zen/tmp/${MOATS}/@tags.json 2>/dev/null ## Get tiddlers with not my email in it
[[ ! -s ~/.zen/tmp/${MOATS}/@tags.json ]] && echo "NO EXTRA @tags.json TIDDLERS TODAY" && exit 0
[[ ! -s ~/.zen/tmp/${MOATS}/@tags.json ]] \
&& echo "NO EXTRA @tags.json TIDDLERS TODAY" \
&& exit 0
# LOG
cat ~/.zen/tmp/${MOATS}/@tags.json
echo "******************TIDDLERS with EMAIL in TAGS treatment"
echo "******************TIDDLERS with new EMAIL in TAGS treatment"
#~ cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/${PLAYER}.tiddlers.json | sed "s~${PLAYER}~ ~g" | jq -rc '.[] | select(.tags | contains("@"))' > ~/.zen/tmp/${MOATS}/@tags.json
## EXTRACT NOT MY EMAIL
################################
## detect NOT MY EMAIL in TODAY TIDDLERS
################################
while read LINE; do
echo "---------------------------------- Sava PalPé mec"
@ -220,7 +240,7 @@ while read LINE; do
## Count emails found
emails=($(echo "$TTAGS" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
nb=${#emails[@]}
zen=$(echo "scale=2; $nb / 10" | bc) ## / divide by 10, 1 zen each
zen=$(echo "scale=2; $nb / 10" | bc) ## / divide by 10 = 1 Zen each
## Get first zmail
ZMAIL="${emails}"

View File

@ -38,7 +38,8 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
cp -f ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/COINS/
## COPY 20h12.log
cp -f /tmp/20h12.log ~/.zen/tmp/${IPFSNODEID}/
rm -f ~/.zen/tmp/${IPFSNODEID}/20h12.log ## TODO REMOVE
cp -f /tmp/20h12.log ~/.zen/tmp/${IPFSNODEID}/20h12.txt
## COPY FRIENDS
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
@ -52,10 +53,11 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
done
## INFORM GPS LOCATION
cp ~/.zen/GPS ~/.zen/tmp/${IPFSNODEID}/
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/GPS ]] \
&& cp ~/.zen/game/players/.current/GPS.json ~/.zen/tmp/${IPFSNODEID}/
[[ -s ~/.zen/game/players/.current/GPS.json ]] \
&& cp ~/.zen/game/players/.current/GPS.json ~/.zen/tmp/${IPFSNODEID}/ \
&& LAT=$(cat ~/.zen/tmp/${IPFSNODEID}/GPS.json | jq -r .[].lat) \
&& LON=$(cat ~/.zen/tmp/${IPFSNODEID}/GPS.json | jq -r .[].lon) \
&& echo "LAT=${LAT}; LON=${LON}" > ~/.zen/GPS
## REFRESH TIMESTAMPING
echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
@ -71,7 +73,7 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
fi
## CLEANING SWARM 30 DAYS OLD
find ~/.zen/tmp/swarm/ -mtime +30 -type d -exec rm -Rf '{}' \;
## CLEANING SWARM 3 DAYS OLD
find ~/.zen/tmp/swarm/ -mtime +3 -type d -exec rm -Rf '{}' \;
exit 0

View File

@ -44,7 +44,7 @@ for PLAYER in ${PLAYERONE[@]}; do
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
echo "##################################################################"
echo "##################################################################"
echo ">>>>> PLAYER : ${PLAYER} >>>>>>>>>>>>> REFRESHING TW STATION"
echo "##################################################################"
@ -52,13 +52,13 @@ for PLAYER in ${PLAYERONE[@]}; do
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
# Get PLAYER wallet amount
COINS=$($MY_PATH/../tools/COINScheck.sh $G1PUB | tail -n 1)
$MY_PATH/../tools/COINScheck.sh $G1PUB > ~/.zen/tmp/g1reveal
cat ~/.zen/tmp/g1reveal ###DEBUG MODE
COINS=$(cat ~/.zen/tmp/g1reveal | tail -n 1)
ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1)
echo "+++ WALLET BALANCE _ $COINS (G1) _ / $ZEN ZEN /"
#~ ## ZENCARD ARE ACTIVATED WITH 1 G1 + 10 ZEN (= 1 €OC) ?
echo "##################################################################"
echo "##################################################################"
echo "################### REFRESH ASTRONAUTE TW ###########################"
echo "##################################################################"
@ -122,7 +122,7 @@ for PLAYER in ${PLAYERONE[@]}; do
[[ $try == 0 ]] \
&& echo "PLAYER ${PLAYER} UNPLUG" \
&& ${MY_PATH}/../tools/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} \
&& ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} \
&& continue
try=$((try-1))
@ -133,7 +133,7 @@ for PLAYER in ${PLAYERONE[@]}; do
continue
else
## FOUND TW
## FOUND TW
#############################################################
## CHECK WHO IS ACTUAL OFFICIAL GATEWAY
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
@ -178,13 +178,13 @@ for PLAYER in ${PLAYERONE[@]}; do
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${UMAPNS}"
## TODATENS ################
TODATENS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}")
echo "GPS UMAP LINK UPDATE
${YESTERDATE} : ${myIPFS}${UMAPNS}
${TODATE} : ${myIPFS}/ipns/${TODATENS}"
## UPDATE TW GPS Tiddler #############
sed -i "s~${UMAPNS}~/ipns/${TODATENS}~g" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
## TODATENS ################
TODATENS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}")
echo "GPS UMAP LINK UPDATE
${YESTERDATE} : ${myIPFS}${UMAPNS}
${TODATE} : ${myIPFS}/ipns/${TODATENS}"
## UPDATE TW GPS Tiddler #############
sed -i "s~${UMAPNS}~/ipns/${TODATENS}~g" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
## STORE IN PLAYER CACHE
echo "_${LAT}_${LON}" > ~/.zen/game/players/${PLAYER}/.umap
@ -198,7 +198,7 @@ for PLAYER in ${PLAYERONE[@]}; do
if [[ ${IPNSTAIL} != ${IPFSNODEID} || ${IPNSTAIL} == "_ASTROPORT_" ]]; then
echo "> I AM ${IPFSNODEID} : PLAYER MOVED TO ${IPNSTAIL} : EJECTION "
echo "UNPLUG PLAYER"
${MY_PATH}/../tools/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ONE"
${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ONE"
echo ">>>> ASTRONAUT ${PLAYER} TW CAPSULE EJECTION TERMINATED"
continue
fi
@ -211,33 +211,35 @@ for PLAYER in ${PLAYERONE[@]}; do
##############################################################
echo "##################################################################"
[[ $(echo "$COINS > 2" | bc -l) -eq 1 ]] \
[[ $(echo "$COINS >= 2" | bc -l) -eq 1 ]] \
&& echo "## Connect_PLAYER_To_Gchange.sh" \
&& ${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}" \
|| echo "1 G1 + 10 ẑen needed to activate ★★★★★ system"
# G1PalPay - 1 G1 + 10 ZEN mini -> Check for G1 TX incoming comments #
[[ $(echo "$COINS > 1" | bc -l) -eq 1 ]] \
&& echo "## RUNNING G1PalPay Wallet Monitoring " \
&& ${MY_PATH}/G1PalPay.sh ${HOME}/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}" \
|| echo "> ZenCard is not activated ($ZEN)"
# G1PalPay - 1 G1 mini -> Check for G1 TX incoming comments #
if [[ $(echo "$COINS >= 1" | bc -l) -eq 1 ]]; then
###########
# G1PalPay.sh #
##############################################################
echo "## RUNNING G1PalPay Wallet Monitoring "
${MY_PATH}/G1PalPay.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}"
###############
# VOEUX.create.sh #
##############################################################
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}" "${G1PUB}"
###############
# VOEUX.refresh.sh #
##############################################################
${MY_PATH}/VOEUX.refresh.sh "${PLAYER}" "${MOATS}" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
else
echo "> ZenCard is not activated ($ZEN)"
fi
### CHECK FOR pending (TODO! In case PAY4SURE have abandonned pendings)
###############
# VOEUX.create.sh #
##############################################################
## SPECIAL TAG "voeu" => Creation G1Voeu (G1Titre) makes AstroBot TW G1Processing
##############################################################
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}" "${G1PUB}"
###############
# VOEUX.refresh.sh #
##############################################################
## RUN ASTROBOT G1Voeux SUBPROCESS (SPECIFIC Ŋ1 COPY)
##############################################################
${MY_PATH}/VOEUX.refresh.sh "${PLAYER}" "${MOATS}" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
###################
# REFRESH PLAYER_feed #
@ -252,32 +254,32 @@ for PLAYER in ${PLAYERONE[@]}; do
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_feed'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key","text":"'${FEEDNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
###########################
# Tiddlers controling GW & API
#~ echo '[{"title":"$:/ipfs/saver/api/http/localhost/5001","tags":"$:/ipfs/core $:/ipfs/saver/api","text":"'$(myPlayerApiGw)'"}]' > ~/.zen/tmp/${MOATS}/5001.json
#~ echo '[{"title":"$:/ipfs/saver/gateway/http/localhost","tags":"$:/ipfs/core $:/ipfs/saver/gateway","text":"'$myIPFS'"}]' > ~/.zen/tmp/${MOATS}/8080.json
###########################
# Tiddlers controling GW & API
#~ echo '[{"title":"$:/ipfs/saver/api/http/localhost/5001","tags":"$:/ipfs/core $:/ipfs/saver/api","text":"'$(myPlayerApiGw)'"}]' > ~/.zen/tmp/${MOATS}/5001.json
#~ echo '[{"title":"$:/ipfs/saver/gateway/http/localhost","tags":"$:/ipfs/core $:/ipfs/saver/gateway","text":"'$myIPFS'"}]' > ~/.zen/tmp/${MOATS}/8080.json
## COPY DATA PRODUCED BY GCHANGE STAR EXTRACTION
FRIENDSFEEDS=$(cat ~/.zen/tmp/${IPFSNODEID}/RSS/${PLAYER}/FRIENDSFEEDS 2>/dev/null)
echo "★★★★★ FRIENDS FEEDS : "${FRIENDSFEEDS}
ASTRONAUTES=$(cat ~/.zen/tmp/${IPFSNODEID}/RSS/${PLAYER}/ASTRONAUTES 2>/dev/null)
echo "★★★★★ FRIENDS TW : "${ASTRONAUTES}
## COPY DATA PRODUCED BY GCHANGE STAR EXTRACTION
FRIENDSFEEDS=$(cat ~/.zen/tmp/${IPFSNODEID}/RSS/${PLAYER}/FRIENDSFEEDS 2>/dev/null)
echo "★★★★★ FRIENDS FEEDS : "${FRIENDSFEEDS}
ASTRONAUTES=$(cat ~/.zen/tmp/${IPFSNODEID}/RSS/${PLAYER}/ASTRONAUTES 2>/dev/null)
echo "★★★★★ FRIENDS TW : "${ASTRONAUTES}
## Change TW FRIENDFEED ie PLAYER RSS IPNS (must fix TW plugin to work)
#~ echo '[{"title":"$:/plugins/astroport/lightbeams/state/subscriptions","text":"'${FRIENDSFEEDS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/friends.json
#~ ## ADD --import "$HOME/.zen/tmp/${MOATS}/friends.json" "application/json" \ ## MANUAL TW RSS REGISTRATION
## Change TW FRIENDFEED ie PLAYER RSS IPNS (must fix TW plugin to work)
#~ echo '[{"title":"$:/plugins/astroport/lightbeams/state/subscriptions","text":"'${FRIENDSFEEDS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/friends.json
#~ ## ADD --import "$HOME/.zen/tmp/${MOATS}/friends.json" "application/json" \ ## MANUAL TW RSS REGISTRATION
## WRITE TIDDLERS IN TW
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
--import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
--output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} --render "$:/core/save/all" "newindex.html" "text/plain"
## WRITE TIDDLERS IN TW
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
--import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
--output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} --render "$:/core/save/all" "newindex.html" "text/plain"
## CHECK IT IS OK
[[ -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ]] \
&& cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
&& rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html
###########################
## CHECK IT IS OK
[[ -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ]] \
&& cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
&& rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html
###########################
####################
@ -303,8 +305,8 @@ for PLAYER in ${PLAYERONE[@]}; do
##############################################################
##################################################
##################################################
################## UPDATING PLAYER MOA
############################### LOCAL "MICRO LEDGER"
################## UPDATING ${PLAYER}/ipfs/moa
[[ $DIFF ]] && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \
~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
@ -326,7 +328,9 @@ for PLAYER in ${PLAYERONE[@]}; do
--output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${PLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]]'
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ]] \
&& echo "NO ${PLAYER} RSS - BAD ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json -"
&& echo "NO ${PLAYER} RSS - BAD "
echo "~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json"
## TODO CREATING 30 DAYS XML RSS STREAM
## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/26
@ -345,25 +349,26 @@ for PLAYER in ${PLAYERONE[@]}; do
#### PLAYER ACCOUNT CLEANING #########
## IF ZEN < 11
## && EMPTY RSS + 30 DAYS BIRTHDATE
## only for less 90 days TW ? && ${DIFF_SECONDS} -lt $(( 90 * 24 * 60 * 60 )) ????
## ==> UNPLUG
[[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" ]] \
&& echo "RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN --" \
&& [[ $(echo "$COINS < 2.1" | bc -l) -eq 1 ]] \
&& [[ ${DIFF_SECONDS} -gt $(( 27 * 24 * 60 * 60 )) ]] \
&& [[ ${DIFF_SECONDS} -gt $(( 27 * 24 * 60 * 60 )) ]] \
&& echo "<html><body><h1>WARNING.</h1> Your TW will be UNPLUGGED and stop being published..." > ~/.zen/tmp/alert \
&& echo "<br><h3>TW : <a href=$(myIpfsGw)/ipfs/${CURCHAIN}> ${PLAYER}</a></h3>ZEN=$ZEN </body></html>" >> ~/.zen/tmp/alert \
&& ${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/alert "TW ALERT" \
&& echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days" \
&& [[ ${DIFF_SECONDS} -gt $(( 30 * 24 * 60 * 60 )) ]] \
&& echo ">>>> PLAYER TW UNPLUG >>>>> ${days} days => BYE BYE ${PLAYER} ZEN=$ZEN" \
&& ${MY_PATH}/../tools/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} \
&& ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} \
&& continue
#################################### UNPLUG ACCOUNT
IRSS=$(ipfs add -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \
&& ipfs name publish --key="${PLAYER}_feed" /ipfs/${IRSS}
######################### REPLACE TW with REDIRECT to latest IPFS or IPNS (reduce 12345 cache size)
######################### REPLACE TW with REDIRECT to latest IPFS or IPNS (reduce 12345 cache size)
[[ ! -z ${TW} ]] && TWLNK="/ipfs/${TW}" || TWLNK="/ipns/${ASTRONAUTENS}"
echo "<meta http-equiv=\"refresh\" content=\"0; url='${TWLNK}'\" />${PLAYER}" \
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
@ -371,7 +376,9 @@ for PLAYER in ${PLAYERONE[@]}; do
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${IRSS}'\" />${PLAYER}" \
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html
#################################################
################### COPY DATA TO UP LEVEL GRIDS
#################################################
if [[ ${LAT} && ${LON} ]]; then
## SECTOR BANK COORD
SECLAT="${LAT::-1}"
@ -380,15 +387,17 @@ for PLAYER in ${PLAYERONE[@]}; do
REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
REGLON=$(echo ${LON} | cut -d '.' -f 1)
## IPFSNODEID 12345 CACHE UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
echo "/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}"
## IPFSNODEID 12345 CACHE UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
cp ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json \
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}
cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}/
echo "<meta http-equiv=\"refresh\" content=\"0; url='${TODATENS}'\" />" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html
fi
@ -405,6 +414,7 @@ for PLAYER in ${PLAYERONE[@]}; do
## CLEANING CACHE
rm -Rf ~/.zen/tmp/${MOATS}
echo
done
echo "============================================ PLAYER.refresh DONE."

View File

@ -72,7 +72,7 @@ mkdir -p ~/.zen/tmp/${MOATS}
## SEND PLAYER LAST KNOW TW
TW=$(ipfs add -Hq ${INDEX} | tail -n 1)
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "<html><body><h1>Hello ${PLAYER},</h1> Your TW is unplugged from Astroport : <a href='${myIPFSGW}/ipfs/${TW}'>LAST TW STATE</a>.<br><h3>May the force be with you.</h3></body></html>" "LAST MESSAGE"
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "<html><body><h1>Hello ${PLAYER},</h1> Your TW is unplugged from Astroport : <a href='${myIPFSGW}/ipfs/${TW}'>TW ARCHIVE</a>.<br>$(cat ~/.zen/game/players/${PLAYER}/secret.june)<br><h3>May the force be with you.</h3></body></html>" "BYE BYE MESSAGE"
echo "PLAYER IPNS KEYS UNPLUGED"
echo "#######################"

View File

@ -12,6 +12,8 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
# UMAP > SECTOR > REGION
## Get from 100 sectors tiddlers with more than 2 signatures
############################################
echo
echo
echo "############################################"
echo "############################################"
echo "############################################"
@ -97,7 +99,7 @@ for REGION in ${REGIONS[@]}; do
rm -f ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
## START WITH LOCAL SECTORS RSS WEEK
RSSNODE=($(ls ~/.zen/tmp/${IPFSNODEID}/SECTORS/_${REGLAT}*_${REGLON}*.week.rss.json 2>/dev/null))
RSSNODE=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}*_${REGLON}*/_${REGLAT}*_${REGLON}*/_${REGLAT}*_${REGLON}*.week.rss.json 2>/dev/null))
for RSS in ${RSSNODE[@]}; do
[[ $(cat ${RSS}) != "[]" ]] \
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
@ -106,7 +108,7 @@ for REGION in ${REGIONS[@]}; do
NL=${#RSSNODE[@]}
## ADD SWARM SECTORS RSS WEEK
RSSWARM=($(ls ~/.zen/tmp/swarm/*/SECTORS/_${REGLAT}*_${REGLON}*.week.rss.json 2>/dev/null))
RSSWARM=($(ls ~/.zen/tmp/swarm/*/UPLANET/SECTORS/_${REGLAT}*_${REGLON}*/_${REGLAT}*_${REGLON}*/_${REGLAT}*_${REGLON}*.week.rss.json 2>/dev/null))
for RSS in ${RSSWARM[@]}; do
[[ $(cat ${RSS}) != "[]" ]] \
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
@ -124,12 +126,24 @@ for REGION in ${REGIONS[@]}; do
mv ~/.zen/tmp/${MOATS}/${REGION}/RSS/.all.json \
~/.zen/tmp/${MOATS}/${REGION}/RSS/_${REGLAT}_${REGLON}.week.rss.json
## PREPARING AiApi link
mkdir -p ~/.zen/tmp/${IPFSNODEID}/REGIONS
## PREPARING JOURNAL
rm -Rf ~/.zen/tmp/${IPFSNODEID}/REGIONS ## TODO REMOVE
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}
RWEEKCID=$(ipfs add -q ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL)
cp ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL \
~/.zen/tmp/${IPFSNODEID}/REGIONS/_${REGLAT}_${REGLON}.JOURNAL.md
~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}/JOURNAL.md
###################################
## NODE PUBLISH REGION TODATENS LINK
echo "<meta http-equiv=\"refresh\" content=\"0; url='${TODATEREGIONNS}'\" />" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}/_index.html
## DEMO : PREPARE Ask.IA link - PROD will be launched during RUNTIME.
echo "<meta http-equiv=\"refresh\" content=\"0; url='https://api.copylaradio.com/tellme/?cid=/ipfs/${RWEEKCID}'\" />" \
@ -152,7 +166,7 @@ for REGION in ${REGIONS[@]}; do
ipfs name publish -k ${TODATE}${REGIONG1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${REGIONG1PUB} ${YESTERDATE}${REGIONG1PUB} ${TODATE}${REGIONG1PUB} > /dev/null 2>&1
ipfs key rm ${REGIONG1PUB} ${YESTERDATE}${REGIONG1PUB} > /dev/null 2>&1
done

View File

@ -11,6 +11,7 @@
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "$MY_PATH/../tools/my.sh"
RSS=$1 ## filepath to RSS
SECTOR=$2 ## Sector identifier _0.0_0.0
@ -23,7 +24,8 @@ INDEX=$4 ## SECTOR TW index file
&& sed "s~_SECTOR_~${SECTOR}~g" ${MY_PATH}/../templates/twsector.html > ${INDEX} \
&& echo "REFRESHING SECTOR FROM empty TEMPLATE *****"
echo
echo
## EXTRACT PLAYER FROM RSS FILE NAME
PLAYER=$(echo ${RSS} | rev | cut -d '/' -f 1 | rev | sed "s~.rss.json~~g")
## GET PLAYER INFORMATION
@ -163,7 +165,7 @@ To Accept<br>
To Refuse<br>
${NUNIQUE[*]} must fork by deleting or modifying New Tiddler title.
<br>
<h2><a href='$(myIpfsGw)/ipfs/QmcSkcJ2j7GAsC2XhVqGSNAKVRpXgxfjjvDbhD5YxrncZY/?room=${MOATS}'>Actual Tiddler</a>Engage discussion about it...</a></h2>
<h2><a href='$(myIpfsGw)${VDONINJA}/?room=${MOATS}'>Actual Tiddler</a>Engage discussion about it...</a></h2>
</body></html>" > ~/.zen/tmp/${MOATS}/g1message
${MY_PATH}/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "TIDDLER COLLISION"

View File

@ -12,6 +12,8 @@ start=`date +%s`
## SECTOR REFRESH
# SHARE & UPDATE IPNS TOGETHER
############################################
echo
echo
echo "############################################"
echo "############################################"
echo "> RUNNING SECTOR.refresh"
@ -135,7 +137,7 @@ for SECTOR in ${SECTORS[@]}; do
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
&& ipfs key rm ${TODATE}${G1PUB} ${YESYERDATE}${G1PUB} ${G1PUB} \
&& ipfs key rm ${TODATE}${G1PUB} ${YESYERDATE}${G1PUB} ${G1PUB} \
&& continue
### NEXT REFRESHER SHUFFLE
@ -174,15 +176,22 @@ for SECTOR in ${SECTORS[@]}; do
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/RSS
rm -f ~/.zen/tmp/${MOATS}/${SECTOR}/RSS/_all.json
################################## TRANSFER SIGNED TIDDLER IN SECTOR TW
#################### RSS2UPlanetSECTORTW #########################
############################ TRANSFER SIGNED TIDDLER IN SECTOR TW
for RSS in ${RSSALL[@]}; do
############################################################
## Extract New Tiddlers and maintain fusion in Sector TW.
${MY_PATH}/../tools/RSS2UPlanetTW.sh "${RSS}" "${SECTOR}" "${MOATS}" "${INDEX}"
############################################################
${MY_PATH}/RSS2UPlanetSECTORTW.sh "${RSS}" "${SECTOR}" "${MOATS}" "${INDEX}"
############################################################
## create sector RSS _all.json
cat ${RSS} >> ~/.zen/tmp/${MOATS}/${SECTOR}/RSS/_all.json
############################################################
done
TOTL=$((${NL}+${NS}))
##############################################################
##############################################################
# Update COIN & ZEN value
echo ${COINS} > ~/.zen/tmp/${MOATS}/${SECTOR}/COINS
echo ${ZEN} > ~/.zen/tmp/${MOATS}/${SECTOR}/ZEN
@ -240,24 +249,23 @@ for SECTOR in ${SECTORS[@]}; do
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON WISH WORLD READY /ipfs/${IAMAP}/world.js"
###########################################################################################
## ADD SECTOR ZENPUB.png & INFO.png
convert -font 'Liberation-Sans' \
-pointsize 80 -fill purple -draw 'text 50,120 "'"${ZEN} Zen"'"' \
-pointsize 30 -fill purple -draw 'text 40, 180 "'"${SECTOR}"'"' \
$MY_PATH/../images/G1WorldMap.png "${HOME}/.zen/tmp/${MOATS}/${SECTOR}.png"
# CREATE G1PUB AMZQR
amzqr ${G1PUB} -l H -p "$MY_PATH/../images/zenticket.png" -c -n ZENPUB.png -d ~/.zen/tmp/${MOATS}/${SECTOR}/
convert ~/.zen/tmp/${MOATS}/${SECTOR}/ZENPUB.png -resize 250 ~/.zen/tmp/${MOATS}/ZENPUB.png
# ADD IT
composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/${MOATS}/ZENPUB.png ~/.zen/tmp/${MOATS}/${SECTOR}.png ~/.zen/tmp/${MOATS}/${SECTOR}/INFO.png
###########################################################################################
## ADD SECTOR ZENPUB.png & INFO.png
convert -font 'Liberation-Sans' \
-pointsize 80 -fill purple -draw 'text 50,120 "'"${ZEN} Zen"'"' \
-pointsize 30 -fill purple -draw 'text 40, 180 "'"${SECTOR}"'"' \
$MY_PATH/../images/G1WorldMap.png "${HOME}/.zen/tmp/${MOATS}/${SECTOR}.png"
# CREATE G1PUB AMZQR
amzqr ${G1PUB} -l H -p "$MY_PATH/../images/zenticket.png" -c -n ZENPUB.png -d ~/.zen/tmp/${MOATS}/${SECTOR}/
convert ~/.zen/tmp/${MOATS}/${SECTOR}/ZENPUB.png -resize 250 ~/.zen/tmp/${MOATS}/ZENPUB.png
# ADD IT
composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/${MOATS}/ZENPUB.png ~/.zen/tmp/${MOATS}/${SECTOR}.png ~/.zen/tmp/${MOATS}/${SECTOR}/INFO.png
## zday marking
rm ~/.zen/tmp/${MOATS}/${SECTOR}/z* 2>/dev/null
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain | rev | cut -d ':' -f 1 | rev 2>/dev/null)
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />${TODATE} ${SECTOR}" > ~/.zen/tmp/${MOATS}/${SECTOR}/z$(date +%A-%d_%m_%Y).html
## zday marking
rm ~/.zen/tmp/${MOATS}/${SECTOR}/z* 2>/dev/null
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />${TODATE} ${SECTOR}" > ~/.zen/tmp/${MOATS}/${SECTOR}/z$(date +%A-%d_%m_%Y).html
###########################################################################################
###########################################################################################
### APPLY ON APP MODEL TODATE REGIONNS LINKING
REGLAT=$(echo ${SLAT} | cut -d '.' -f 1)
REGLON=$(echo ${SLON} | cut -d '.' -f 1)
@ -273,21 +281,21 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />${TODATE
-e "s~_ZONEIPFS_~${ZCHAIN}~g" \
-e "s~_UPZONENS_~${TODATEREGIONNS}~g" \
-e "s~_SECTORG1PUB_~${G1PUB}~g" \
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
-e "s~_HACKGIPFS_~${HACKGIPFS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_LAT_~${REGLAT}~g" \
-e "s~_LON_~${REGLON}~g" \
-e "s~_LAT_~${LAT::-1}~g" \
-e "s~_LON_~${LON::-1}~g" \
-e "s~_EARTHCID_~${EARTHCID}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${REGLAT}\&southWestLon=${REGLON}\&deg=1~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html
## TODO get from ~/.zen/tmp/${IPFSNODEID}/REGIONS/_${REGLAT}_${REGLON}.week.cid produced by REGION.refresh
# -e "s~_RWEEKCID_~/ipfs/QmY4rLRgSXjhhsW3WoKUJYpLe2A1dJCFXb7stNLcAp95w9~g" \
##################################
cp -f ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html ~/.zen/tmp/${MOATS}/${SECTOR}/index.html
rm ~/.zen/tmp/${MOATS}/${SECTOR}/index.html ## MAKE SECTOR VISIBLE ##
###################################################### CHAINING BACKUP
IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1)
@ -303,7 +311,7 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />${TODATE
echo "% START PUBLISHING ${SECTOR} ${myIPFS}/ipns/${TODATENS}"
start=`date +%s`
ipfs name publish -k ${TODATE}${G1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${TODATE}${G1PUB} ${YESYERDATE}${G1PUB} ${G1PUB} > /dev/null 2>&1
ipfs key rm ${YESTERDATE}${G1PUB} ${G1PUB} > /dev/null 2>&1
end=`date +%s`
echo "_____SECTOR${SECTOR} PUBLISH time was "`expr $end - $start` seconds.
@ -313,11 +321,16 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />${TODATE
## EXTRACT SECTOR LAST WEEK TIDDLERS TO IPFSNODEID CACHE
echo "(☉_☉ ) ${REGION}.week.rss.json (☉_☉ )"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/SECTORS/
rm -f ~/.zen/tmp/${IPFSNODEID}/SECTORS/${SECTOR}.week.rss.json
rm -Rf ~/.zen/tmp/${IPFSNODEID}/SECTORS/ ## TODO REMOVE
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON}
## CREATING 7 DAYS JSON RSS STREAM
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${IPFSNODEID}/SECTORS --render '.' "${SECTOR}.week.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-7]!is[system]!tag[G1Voeu]]'
--output ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON} --render '.' "${SECTOR}.week.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-7]!is[system]!tag[G1Voeu]]'
###################################
## NODE CACHE SECTOR TODATENS
echo "<meta http-equiv=\"refresh\" content=\"0; url='${TODATENS}'\" />" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON}/_index.html
## TODO FILTER INFORMATION WITH MULTIPLE SIGNATURES (DONE in REGION.refresh.sh)
## TODO EXPORT AS RSS ## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/28

View File

@ -11,6 +11,8 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
## SEEK FOR UPLANET KEYS
# GET & UPDATE IPNS
############################################
echo
echo
echo "############################################"
echo "## RUNNING UPLANET.refresh"
echo "############################################"
@ -23,144 +25,146 @@ mkdir ~/.zen/tmp/${MOATS}
#################################################################
## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port
############################
## RUNING FOR ALL UMAP FOUND IN STATION MAP CACHE : "_LAT_LON"
## RUNING FOR ALL UMAP FOUND IN STATION MAP CACHE : "_LAT_LON"
## SEARCH UMAP (created by PLAYER.refresh.sh) /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
MEMAPS=($(ls -td ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/* | rev | cut -d '/' -f 1 | rev | sort | uniq 2>/dev/null))
SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* | rev | cut -d '/' -f 1 | rev | sort | uniq 2>/dev/null) )
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
echo "ACTIVATED UMAPS : ${unique_combined[@]}" # "_LAT_LON" directories
## SEARCH UMAP (created by PLAYER.refresh.sh) /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
MEMAPS=($(ls -td ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
echo "ACTIVATED UMAPS : ${unique_combined[@]}" # "_LAT_LON" directories
for UMAP in ${unique_combined[@]}; do
for UMAP in ${unique_combined[@]}; do
start=`date +%s`
echo "____________REFRESHING ${UMAP}__________"
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
start=`date +%s`
echo "____________REFRESHING ${UMAP}__________"
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
[[ ${LAT} == "" || ${LON} == "" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
[[ ${LAT} == "null" || ${LON} == "null" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
[[ ${LAT} == "" || ${LON} == "" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
[[ ${LAT} == "null" || ${LON} == "null" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
## SECTOR BANK COORD
SECLAT="${LAT::-1}"
SECLON="${LON::-1}"
## REGION
REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
REGLON=$(echo ${LON} | cut -d '.' -f 1)
## SECTOR BANK COORD
SECLAT="${LAT::-1}"
SECLON="${LON::-1}"
## REGION
REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
REGLON=$(echo ${LON} | cut -d '.' -f 1)
##############################################################
## UMAP WALLET CHECK
##############################################################
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
[[ ! ${G1PUB} ]] && echo "ERROR generating WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1)
echo "UMAP (${COINS} G1) WALLET : ${G1PUB}"
##############################################################
## UMAP WALLET CHECK
##############################################################
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
[[ ! ${G1PUB} ]] && echo "ERROR generating WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1)
echo "UMAP (${COINS} G1) WALLET : ${G1PUB}"
## ORIGIN ##########################################################
## CALCULATE INITIAL UMAP GEOSPACIAL IPNS KEY
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
ipfs key rm ${G1PUB} > /dev/null 2>&1
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo "ORIGIN : ${myIPFS}/ipns/${UMAPNS}"
## ORIGIN ##########################################################
## CALCULATE INITIAL UMAP GEOSPACIAL IPNS KEY
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
ipfs key rm ${G1PUB} > /dev/null 2>&1
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo "ORIGIN : ${myIPFS}/ipns/${UMAPNS}"
###################### SPATIO TEMPORAL KEYS
## YESTERDATE ###############
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${UPLANETNAME}${LON}"
ipfs key rm ${YESTERDATE}${G1PUB} > /dev/null 2>&1
YESTERDATENS=$(ipfs key import ${YESTERDATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv)
echo "YESTERDAY : ${myIPFS}/ipns/${YESTERDATENS}"
###################### SPATIO TEMPORAL KEYS
## TODATE #########################################
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
echo "TODAY : ${myIPFS}/ipns/${TODATENS}"
## TODATE #########################################
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
echo "TODAY : ${myIPFS}/ipns/${TODATENS}"
## YESTERDATE ###############
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${UPLANETNAME}${LON}"
ipfs key rm ${YESTERDATE}${G1PUB} > /dev/null 2>&1
YESTERDATENS=$(ipfs key import ${YESTERDATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv)
echo "YESTERDAY : ${myIPFS}/ipns/${YESTERDATENS}"
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
## IPFS GET YESTERDATENS
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo "## IPFS GET YESTERDATENS"
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
## FORMAT CONTROL WARNING
[[ ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN || ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} ]] \
&& echo ">>> INFO - INTIALIZE UMAP FORMAT - NEW UMAP KEY -" \
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} \
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN \
&& echo ${MOATS} > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats
## FORMAT CONTROL WARNING
[[ ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN || ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} ]] \
&& echo ">>> INFO - INTIALIZE UMAP FORMAT - NEW UMAP KEY -" \
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} \
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN \
&& echo ${MOATS} > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/RSS
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/RSS
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW
echo "~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/"
## zday of the week for IPFSNODEID
rm -f ~/.zen/tmp/${MOATS}/${UMAP}/z*.html 2>/dev/null
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain | rev | cut -d ':' -f 1 | rev 2>/dev/null)
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/z$(date +%A-%d_%m_%Y).html
## zday of the week for IPFSNODEID
rm -f ~/.zen/tmp/${MOATS}/${UMAP}/z*.html 2>/dev/null
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain 2>/dev/null | rev | cut -d ':' -f 1 | rev 2>/dev/null)
[[ "${ZCHAIN}" != "" ]] \
&& echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/z$(date +%A-%d_%m_%Y).html
# ++++++++++++++++++++ - - - - ADAPT TO NODE TREATMENT TIME
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null)
# ZMOATS SHOULD BE MORE THAT 5 HOURS.
MOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
ZMOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${ZMOATS})
DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
hours=$((DIFF_SECONDS / 3600))
minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
seconds=$((DIFF_SECONDS % 60))
echo "UMAP DATA is ${hours} hours ${minutes} minutes ${seconds} seconds "
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
########################################################
## NODE SELECTION in UMAP.refresher
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/UMAP.refresher"
ALLNODES=($(cat ${UREFRESH} 2>/dev/null)) # ${ALLNODES[@]}
STRAPS=($(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | grep -v '^[[:space:]]*$')) ## ${STRAPS[@]}
########################################################
## NODE SELECTION in UMAP.refresher
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/UMAP.refresher"
ALLNODES=($(cat ${UREFRESH} 2>/dev/null)) # ${ALLNODES[@]}
STRAPS=($(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | grep -v '^[[:space:]]*$')) ## ${STRAPS[@]}
if [[ ${ALLNODES[@]} == "" ]]; then
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## FILL UMAP.refresher file with all STRAPS
done
ALLNODES=($(cat ${UREFRESH} 2>/dev/null)) # ${ALLNODES[@]}
fi
ACTINGNODE=${ALLNODES[0]} ## FIST NODE IN UMAP.refresher
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
## IF NOT UPDATED FOR TOO LONG
[ ${DIFF_SECONDS} -gt $(( 26 * 60 * 60 )) ] \
&& echo "More than 26H update - BOOSTRAP 0 ACTION -" \
&& ACTINGNODE=${STRAPS[0]}
echo "* ACTINGNODE=${ACTINGNODE}"
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
&& ipfs key rm "${TODATE}${G1PUB}" "${YESYERDATE}${G1PUB}" "${G1PUB}" \
&& continue
########################################
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PASSING THERE MAKE IPFSNODEID UMAP REFRESHER
## NEXT REFRESHER
# TODO: INTRODUCE NODE BALANCE AND CHOOSE THE MOST CONFIDENT ONE
rm ${UREFRESH}
if [[ ${ALLNODES[@]} == "" ]]; then
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## FILL UMAP.refresher file with all STRAPS
done
# SHUFFLE UMAP.refresher
cat ${UREFRESH} | sort | uniq | shuf > ${UREFRESH}.shuf
mv ${UREFRESH}.shuf ${UREFRESH}
## NEXT REFRESHER
echo ">> NEXT REFRESHER WILL BE $(cat ${UREFRESH} | head -n 1)"
######################################################## # NODE SELECTION in UMAP.refresher
ALLNODES=($(cat ${UREFRESH} 2>/dev/null)) # ${ALLNODES[@]}
fi
# %%%%%%%%%% ##################################################
## SECTOR LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${SLAT}_${SLON}
# %%%%%%%%%% ##################################################
ACTINGNODE=${ALLNODES[0]} ## FIST NODE IN UMAP.refresher
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
# ++++++++++++++++++++ - - - - FIND LAST TREATMENT TIME
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null) || ZMOATS=${MOATS}
# ZMOATS SHOULD BE MORE THAT 5 HOURS.
MOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
ZMOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${ZMOATS})
DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
hours=$((DIFF_SECONDS / 3600))
minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
seconds=$((DIFF_SECONDS % 60))
echo "UMAP DATA is ${hours} hours ${minutes} minutes ${seconds} seconds "
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## IF NOT UPDATED FOR TOO LONG
[[ ${DIFF_SECONDS} -gt $(( 26 * 60 * 60 )) || ${DIFF_SECONDS} -eq 0 ]] \
&& echo "More than 26H update - BOOSTRAP 0 ACTION -" \
&& ACTINGNODE=${STRAPS[0]}
echo "* ACTINGNODE=${ACTINGNODE}"
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
&& ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}" \
&& continue
########################################
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PASSING THERE MAKE IPFSNODEID UMAP REFRESHER
## NEXT REFRESHER
# TODO: INTRODUCE NODE BALANCE AND CHOOSE THE MOST CONFIDENT ONE
rm ${UREFRESH}
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## FILL UMAP.refresher file with all STRAPS
done
# SHUFFLE UMAP.refresher
cat ${UREFRESH} | sort | uniq | shuf > ${UREFRESH}.shuf
mv ${UREFRESH}.shuf ${UREFRESH}
## NEXT REFRESHER
echo ">> NEXT REFRESHER WILL BE $(cat ${UREFRESH} | head -n 1)"
######################################################## # NODE SELECTION in UMAP.refresher
# %%%%%%%%%% ##################################################
## SECTOR LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${SLAT}_${SLON}
# %%%%%%%%%% ##################################################
SLAT="${LAT::-1}"
SLON="${LON::-1}"
SECTOR="_${SLAT}_${SLON}"
@ -179,9 +183,9 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${SLAT}_${SLON}
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${SECTORNS}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/${SLAT}_${SLON}/index.html
# %%%%%%%%%% ##################################################
## REGION LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ${RLAT}_${RLON}
# %%%%%%%%%% ##################################################
# %%%%%%%%%% ##################################################
## REGION LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ${RLAT}_${RLON}
# %%%%%%%%%% ##################################################
RLAT=$(echo ${LAT} | cut -d '.' -f 1)
RLON=$(echo ${LON} | cut -d '.' -f 1)
REGION="_${RLAT}_${RLON}"
@ -200,35 +204,35 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${TODATEREGIONNS}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}/index.html
# %%%%%%%%%% ##################################################
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
# %%%%%%%%%% ##################################################
cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json ~/.zen/tmp/${MOATS}/${UMAP}/RSS/ 2>/dev/null
RSSFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json 2>/dev/null))
for RSSFILE in ${RSSFILES[@]}; do
cp ${RSSFILE} ~/.zen/tmp/${MOATS}/${UMAP}/RSS/
done
# %%%%%%%%%% ##################################################
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
# %%%%%%%%%% ##################################################
cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json ~/.zen/tmp/${MOATS}/${UMAP}/RSS/ 2>/dev/null
RSSFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json 2>/dev/null))
for RSSFILE in ${RSSFILES[@]}; do
cp ${RSSFILE} ~/.zen/tmp/${MOATS}/${UMAP}/RSS/
done
# %%%%%%%%%% ##################################################
## COLLECT TW LINKS FROM NODE & SWARM
# %%%%%%%%%% ##################################################
cp -r ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/* ~/.zen/tmp/${MOATS}/${UMAP}/TW/ 2>/dev/null
TWFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW/${ZMAIL}
cp ${TWRED} ~/.zen/tmp/${MOATS}/${UMAP}/TW/${ZMAIL}/
done
# %%%%%%%%%% ##################################################
## COLLECT TW LINKS FROM NODE & SWARM
# %%%%%%%%%% ##################################################
cp -r ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/* ~/.zen/tmp/${MOATS}/${UMAP}/TW/ 2>/dev/null
TWFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW/${ZMAIL}
cp ${TWRED} ~/.zen/tmp/${MOATS}/${UMAP}/TW/${ZMAIL}/
done
##################################
##################################
## OSM2IPFS
### UMAP = 0.01° Planet Slice
UMAPGEN="${EARTHCID}/Umap.html?southWestLat=${LAT}&southWestLon=${LON}&deg=0.01&ipns=${TODATENS}/_index.html"
USATGEN="${EARTHCID}/Usat.html?southWestLat=${LAT}&southWestLon=${LON}&deg=0.01&ipns=${TODATENS}/_index.html"
echo "<meta http-equiv=\"refresh\" content=\"0; url='${UMAPGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Umap.html
echo "<meta http-equiv=\"refresh\" content=\"0; url='${USATGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Usat.html
### UMAP = 0.01° Planet Slice
UMAPGEN="${EARTHCID}/Umap.html?southWestLat=${LAT}&southWestLon=${LON}&deg=0.01&ipns=${TODATENS}/_index.html"
USATGEN="${EARTHCID}/Usat.html?southWestLat=${LAT}&southWestLon=${LON}&deg=0.01&ipns=${TODATENS}/_index.html"
echo "<meta http-equiv=\"refresh\" content=\"0; url='${UMAPGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Umap.html
echo "<meta http-equiv=\"refresh\" content=\"0; url='${USATGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Usat.html
## ¤$£€ removed copy OSM map to IPFS. TODO. scrap tiles instead of screen copy
## ¤$£€ removed copy OSM map to IPFS. TODO. scrap tiles instead of screen copy
## TODO # GET SCREENSHOT UMAP SECTOR & REGION JPG
## PROBLEM ON LIBRA ... MORE TEST NEEDED ...
#~ [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/Umap.jpg ]] \
@ -238,9 +242,9 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
#~ [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/Usat.jpg ]] \
#~ && python ${MY_PATH}/../tools/page_screenshot.py "${myIPFS}${USATGEN}" ~/.zen/tmp/${MOATS}/${UMAP}/Usat.jpg 900 900 2>/dev/null \
#~ && [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/Usat.jpg ]] && killall chrome
#### NOT WORKING !!!
#### NOT WORKING !!!
## GEOLINKING CALCULATE SURROUNDING UMAPS ###############################
## GEOLINKING CALCULATE SURROUNDING UMAPS ###############################
#~ if [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/geolinks.json ]]; then
#~ ${MY_PATH}/../tools/Umap_geolinks.sh "${LAT}" "${LON}" "${UMAP}" "${MOATS}" "${UMAPNS}"
@ -249,149 +253,151 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
#~ ### SET navigator.html ## MAKE EVOLVE template/umap.html
#~ cp ${MY_PATH}/../templates/umap.html ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Umap.html
#~ cat ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Umap.html | sed "s~Umap~Usat~g" > ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Usat.html
#### IS IT USEFUL ?..??
#### IS IT USEFUL ?..??
####################################
# %%%%%%%%%% ##################################################
####################################
# %%%%%%%%%% ##################################################
## GET FROM WEB2.0 POI's AROUND >>>>>>>>>>>>>>>>>>>>>>>>>
# %%%%%%%%%% ##################################################
####################################
echo "################### WEB2.0 SCRAPING TIME >>>>>>>>>>>>>>>>"
## RECORD P4N SPOT DATA
echo "* park4night : https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr"
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json ]] && touch ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \
&& curl -s "https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
&& [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json) ]] \
&& mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json \
&& echo "UPDATED PARK4NIGHT" \
|| rm ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json
# %%%%%%%%%% ##################################################
####################################
echo "################### WEB2.0 SCRAPING TIME >>>>>>>>>>>>>>>>"
## RECORD P4N SPOT DATA
echo "* park4night : https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr"
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json ]] && touch ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \
&& curl -s "https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
&& [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json) ]] \
&& mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json \
&& echo "UPDATED PARK4NIGHT" \
|| rm ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json
####################################
echo "* gchange : ./tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON}"
## GET 100KM GCHANGE ADS ( https://data.gchange.fr )
${MY_PATH}/../tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange50.json
####################################
echo "* gchange : ./tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON}"
## GET 100KM GCHANGE ADS ( https://data.gchange.fr )
${MY_PATH}/../tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange50.json
echo "MAKING _index.p4n.html with ./templates/P4N/index.html"
## CREATE INDEX LOADING JSONs ON OPENSTREETMAP
cat ${MY_PATH}/../templates/P4N/index.html \
| sed -e "s~43.2218~${LAT}~g" \
-e "s~1.3977~${LON}~g" \
-e "s~_SERVICE_~Commons~g" \
-e "s~_UMAP_~${UMAP}~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.p4n.html
echo "MAKING _index.p4n.html with ./templates/P4N/index.html"
## CREATE INDEX LOADING JSONs ON OPENSTREETMAP
cat ${MY_PATH}/../templates/P4N/index.html \
| sed -e "s~43.2218~${LAT}~g" \
-e "s~1.3977~${LON}~g" \
-e "s~_SERVICE_~Commons~g" \
-e "s~_UMAP_~${UMAP}~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.p4n.html
# %%%%%%%%%% ##################################################
########################################################
echo "CREATING SPHERICAL LOCATIONS"
# %%%%%%%%%% ##################################################
## PREPARE SPHERE MAP ##################################################################
echo "var examples = {};
examples['locations'] = function() {
var locations = {
" > ~/.zen/tmp/world.js
floop=1
# %%%%%%%%%% ##################################################
########################################################
echo "CREATING SPHERICAL LOCATIONS"
# %%%%%%%%%% ##################################################
## PREPARE SPHERE MAP ##################################################################
echo "var examples = {};
examples['locations'] = function() {
var locations = {
" > ~/.zen/tmp/world.js
floop=1
SWARMTW=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
NODETW=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
TWFILES=("${SWARMTW[@]}" "${NODETW[@]}")
SWARMTW=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
NODETW=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
TWFILES=("${SWARMTW[@]}" "${NODETW[@]}")
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
TWADD=$(cat ${TWRED} | grep -o "/ipns/[^\"]*" | sed "s/'$//")
[[ -z ${TWADD} ]] && TWADD=$(cat ${TWRED} | grep -o "/ipfs/[^\"]*" | sed "s/'$//")
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
TWADD=$(cat ${TWRED} | grep -o "/ipns/[^\"]*" | sed "s/'$//")
[[ -z ${TWADD} ]] && TWADD=$(cat ${TWRED} | grep -o "/ipfs/[^\"]*" | sed "s/'$//")
## ADD ASTRONAUTNS ON SECTOR WORLD MAP
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${ZMAIL}"',
link: '"${TWADD}"'
}
," >> ~/.zen/tmp/world.js
((floop++))
done
# REMOVE la dernière virgule
sed -i '$ d' ~/.zen/tmp/world.js
##################################
## FINISH LOCATIONS
echo "
};
\$('#sphere').earth3d({
locationsElement: \$('#locations'),
dragElement: \$('#locations'),
locations: locations
});
};
" >> ~/.zen/tmp/world.js
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON UMAP WORLD READY /ipfs/${IAMAP}/world.js"
###########################################################################################
### APPLY ON APP MODEL
SECLAT="${LAT::-1}"
SECLON="${LON::-1}"
SECTOR="_${SECLAT}_${SECLON}"
TODATESECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}")
PHONEBOOTH="${G1PUB::30}"
cat ${MY_PATH}/../templates/UPlanetUmap/index.html \
| sed -e "s~_ZONE_~UMAP ${UMAP}~g" \
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${TODATENS}~g" \
-e "s~_UPZONENS_~${TODATESECTORNS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${LAT}\&southWestLon=${LON}\&deg=0.01~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.html
## Make it root App
#~ mv ~/.zen/tmp/${MOATS}/${UMAP}/_index.html \
#~ ~/.zen/tmp/${MOATS}/${UMAP}/index.html
##################################
###########################################################################################
########################################################
## CREATE .all.json for RSS in this UMAP
${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${MOATS}/${UMAP}/RSS
##############################################################
############################ PUBLISHING UMAP
##############################################################
UMAPROOT=$(ipfs add -rwHq ~/.zen/tmp/${MOATS}/${UMAP}/* | tail -n 1)
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain | rev | cut -d ':' -f 1 | rev 2>/dev/null)
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null)
[[ ${ZCHAIN} && ${ZMOATS} ]] \
&& cp ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain.${ZMOATS} \
&& echo "UPDATING MOATS"
## MICRO LEDGER CHAIN CHANGED or INIT ?
[[ ${ZCHAIN} != ${UMAPROOT} || ${ZCHAIN} == "" ]] \
&& echo "${MOATS}:${IPFSNODEID}:${UMAPROOT}" > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain \
&& echo "${MOATS}" > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats \
&& UMAPROOT=$(ipfs add -rwHq ~/.zen/tmp/${MOATS}/${UMAP}/* | tail -n 1) && echo "ROOT was ${ZCHAIN}"
echo "PUBLISHING ${TODATE} UMAPROOT : ${myIPFS}/ipfs/${UMAPROOT}"
ipfs name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
end=`date +%s`
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
ipfs key rm "${TODATE}${G1PUB}" "${YESYERDATE}${G1PUB}" "${G1PUB}" ## REMOVE IPNS KEY
## ADD ASTRONAUTNS ON SECTOR WORLD MAP
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${ZMAIL}"',
link: '"${TWADD}"'
}
," >> ~/.zen/tmp/world.js
((floop++))
done
# REMOVE la dernière virgule
sed -i '$ d' ~/.zen/tmp/world.js
##################################
## FINISH LOCATIONS
echo "
};
\$('#sphere').earth3d({
locationsElement: \$('#locations'),
dragElement: \$('#locations'),
locations: locations
});
};
" >> ~/.zen/tmp/world.js
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON UMAP WORLD READY /ipfs/${IAMAP}/world.js"
###########################################################################################
### APPLY ON APP MODEL
SECLAT="${LAT::-1}"
SECLON="${LON::-1}"
SECTOR="_${SECLAT}_${SECLON}"
TODATESECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}")
PHONEBOOTH="${G1PUB::30}"
cat ${MY_PATH}/../templates/UPlanetUmap/index.html \
| sed -e "s~_ZONE_~UMAP ${UMAP}~g" \
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${TODATENS}~g" \
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_HACKGIPFS_~${HACKGIPFS}~g" \
-e "s~_UPZONENS_~${TODATESECTORNS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${LAT}\&southWestLon=${LON}\&deg=0.01~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.html
## Make it root App
#~ mv ~/.zen/tmp/${MOATS}/${UMAP}/_index.html \
#~ ~/.zen/tmp/${MOATS}/${UMAP}/index.html
##################################
###########################################################################################
########################################################
## CREATE .all.json for RSS in this UMAP
${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${MOATS}/${UMAP}/RSS
##############################################################
############################ PUBLISHING UMAP
##############################################################
UMAPROOT=$(ipfs add -rwHq ~/.zen/tmp/${MOATS}/${UMAP}/* | tail -n 1)
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain | rev | cut -d ':' -f 1 | rev 2>/dev/null)
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null)
[[ ${ZCHAIN} && ${ZMOATS} ]] \
&& cp ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain.${ZMOATS} \
&& echo "UPDATING MOATS"
## MICRO LEDGER CHAIN CHANGED or INIT ?
[[ ${ZCHAIN} != ${UMAPROOT} || ${ZCHAIN} == "" ]] \
&& echo "${MOATS}:${IPFSNODEID}:${UMAPROOT}" > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain \
&& echo "${MOATS}" > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats \
&& UMAPROOT=$(ipfs add -rwHq ~/.zen/tmp/${MOATS}/${UMAP}/* | tail -n 1) && echo "ROOT was ${ZCHAIN}"
echo "PUBLISHING ${TODATE} UMAPROOT : ${myIPFS}/ipfs/${UMAPROOT}"
ipfs name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
end=`date +%s`
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}" ## REMOVE IPNS KEY
done
### SECTOR = 0.1° Planet Slice
${MY_PATH}/SECTOR.refresh.sh "${unique_combined[@]}"
${MY_PATH}/SECTOR.refresh.sh "${unique_combined[@]}"
### REGION = 1° Planet Slice
${MY_PATH}/REGION.refresh.sh "${unique_combined[@]}"
${MY_PATH}/REGION.refresh.sh "${unique_combined[@]}"

View File

@ -553,7 +553,7 @@ echo "<html><head>
}
</style></head>
<body>
<h1>UPlanet : ZenCard</h1>" > ~/.zen/tmp/${MOATS}/ZenCard.html
<h1>UPlanet : ZenCard + <a href='${myIPFS}/ipns/${ASTRONAUTENS}'>TW</a></h1>" > ~/.zen/tmp/${MOATS}/ZenCard.html
asciiart="${MY_PATH}/../images/astroport.art"
while IFS= read -r line
do
@ -561,11 +561,11 @@ do
echo "<br>" >> ~/.zen/tmp/${MOATS}/ZenCard.html
done <"$asciiart"
echo "<h1><a href='${myIPFS}/ipns/${ASTRONAUTENS}'>TW</a></h1>
<a href='${myIPFSGW}${IASTRO}'>ZenCard<br><img src='${myIPFSGW}${IASTRO}'\></a>
echo "<h1></h1>
<a href='${myIPFSGW}${IASTRO}'>ZenCard ${G1PUB}<br><img src='${myIPFSGW}${IASTRO}'\><br></a>
<br></body></html>" >> ~/.zen/tmp/${MOATS}/ZenCard.html
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/ZenCard.html "ZenCard ${PLAYER} "
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/ZenCard.html "ZenCard (${PLAYER}) "
#~ mpack -a -s "✅ UPlanet : ZenCard" -d ~/.zen/tmp/${MOATS}/intro.txt \
#~ ~/.zen/tmp/${MOATS}/pseudo.png ${PLAYER}
@ -593,14 +593,14 @@ do
done <"$asciiart"
echo "
<h3> * 0.1 <a href='${myIPFS}/ipns/${DEMAINSECTORNS}'>${SECTOR}</a> ${DEMAINDATE} </h3>
<h3> <--> 0.1 SECTOR : <a href='${EARTHCID}/map_render.html?southWestLat=${LAT::-1}&southWestLon=${LON::-1}&deg=0.1'>${SECTOR}</a> <--> </h3>
<br><a href='${myIPFS}/ipns/${ASTRONAUTENS}#AstroID'>AstroID<br><img src='${myIPFSGW}${ASTROQR}'\></a>
<br>SECRET1=$SALT SECRET2=$PEPPER ($PASS)<br>
<h3>ASTROPORT : <a href='${myAPI}'>NODE#${IPFSNODEID}</a></h3>
<h3>ASTROPORT : <a href='${myIPFS}/ipns/${IPFSNODEID}'>/ipns/${IPFSNODEID}</a></h3>
<a href='https://qo-op.com'>Uplanet</a>
</body></html>" >> ~/.zen/tmp/${MOATS}/AstroID.html
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/AstroID.html "AstroID ${PLAYER} "
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/AstroID.html "AstroID (${PLAYER}) "
#~ mpack -a -s "✅ UPlanet : AstroID ($PASS)" -d ~/.zen/tmp/${MOATS}/intro.txt \
#~ $HOME/.zen/game/players/${PLAYER}/AstroID.png ${PLAYER}

View File

@ -15,6 +15,8 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
# ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/*
# _PLAYER.json
# change SWARM memory
### # ~/.zen/tmp/${IPFSNODEID}/WISH/${WISHNAME}/${PLAYER}/*
PLAYER="$1" ## IPNS KEY NAME - G1PUB - PLAYER ...
[[ ! ${PLAYER} ]] && echo "Please provide PLAYER publish key" && exit 1
@ -37,9 +39,6 @@ INDEX="$3"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu
## PROTOCOL EVOLUTION RUN & REMOVE
rm -Rf ~/.zen/tmp/${IPFSNODEID}/${PLAYER}
###############################
####### NEED G1 / ZEN TO RUN
[[ ${COINS} == "null" || ${COINS} == "" ]] \

3
WWW/FAVICON/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# Images & icons
Add favicon from the web2.0 you wish to copy to WEB3

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 870 B

After

Width:  |  Height:  |  Size: 870 B

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 822 B

View File

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 198 B

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

13
WWW/Readme.md Normal file
View File

@ -0,0 +1,13 @@
# WWW
This directory contains "ASTROBOT" programs templates
+ some icons and favicons for web scraping services included in UMAP during ```/RUNTIME/UPLANET.refresh.sh```
* example:
```/ASTROBOT/G1CopierYoutube.sh```
```/WWW/CopierYoutube/```
_sandbox
just piece of code... you can use and make official

View File

@ -17,15 +17,22 @@ ME="${0##*/}"
###################################################################
### CREER VOTRE PROPRE VERSION DU JEU
### List games/E@MAIL/ directories
## PUT A PROPOSAL ON THE METHOD
## ADD PROPOSAL ON THE METHOD
GAMES_DIR="games"
GAMES=$(find "$GAMES_DIR" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
GAMES=$(ls $MY_PATH/games/)
GAMES=($(ls -d $MY_PATH/games/))
# Above methods are breaking with games names containing SPACE !
## cd METHOD resist to " " space
cd games && GAMES=(".." *) && cd ..
## but can still be fooled...
# BASH is CREOLE
# this cd *@* METHOD resist to " " space
cd games \
&& GAMES=(".." *@*) && cd .. \
|| GAMES=".."
## but can still be fooled by file...
## personalisez le prompt
PS3="CHOIX DU GAME : __ "
select game in "${GAMES[@]}"; do

View File

@ -0,0 +1 @@
adventure.sh

View File

@ -0,0 +1,49 @@
#!/bin/bash
###################################################################
# This Launch script is based on BashVenture.
#
# Remember, kids - sharing is caring! Keep it open. Spread the love.
# - @BenNunney
# Thanks and gratitude to all living creatures and the whole creation.
# - @Fred
# $AGE×365,25×24×60×60×9,807÷299792458 = RELATIVE LIGHT GRAVITY SPEED
###################################################################
# Guide avancé d'écriture des scripts Bash : https://abs.traduc.org/abs-fr/
# GAMESHELL : https://github.com/phyver/GameShell/
###################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
###################################################################
### CREER VOTRE PROPRE VERSION DU JEU
### CHOISIR SCENARIO
###################################################################
if hash uuidgen 2>/dev/null; then
homefolder=$(pwd)
newplayer=$(uuidgen)
## Copy Player Game Files
mkdir -p $HOME/.zen/adventure/$newplayer
cp -r $MY_PATH/rooms $HOME/.zen/adventure/$newplayer/rooms
cp -r $MY_PATH/art $HOME/.zen/adventure/$newplayer/art
cp -r $MY_PATH/script $HOME/.zen/adventure/$newplayer/script
cp -r $MY_PATH/logic $HOME/.zen/adventure/$newplayer/logic
fi
###################################################################
echo "Loading..."
echo
sleep 4
###################################################################
if hash uuidgen 2>/dev/null; then
cd $HOME/.zen/adventure/$newplayer/rooms
else
cd rooms
fi
./start.sh
###################################################################
if hash uuidgen 2>/dev/null; then
cd "$homefolder"
rm -r $HOME/.zen/adventure/$newplayer
fi
echo "To continue..."
exit

View File

@ -0,0 +1,30 @@
________ ________ _________ ________ ________ ________ ________
|\ __ \|\ ____\|\___ ___\\ __ \|\ __ \|\ __ \|\ __ \
\ \ \|\ \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ \ \|\ \ \ \|\ \
\ \ __ \ \_____ \ \ \ \ \ \ _ _\ \ \\\ \ \ ____\ \ \\\ \
\ \ \ \ \|____|\ \ \ \ \ \ \ \\ \\ \ \\\ \ \ \___|\ \ \\\ \
\ \__\ \__\____\_\ \ \ \__\ \ \__\\ _\\ \_______\ \__\ \ \_______\
\|__|\|__|\_________\ \|__| \|__|\|__|\|_______|\|__| \|_______|
\|_________|
___ ___ _______ ________ ________ ___ ________ ________
|\ \ / /|\ ___ \ |\ __ \|\ ____\|\ \|\ __ \|\ ___ \
\ \ \ / / | \ __/|\ \ \|\ \ \ \___|\ \ \ \ \|\ \ \ \\ \ \
\ \ \/ / / \ \ \_|/_\ \ _ _\ \_____ \ \ \ \ \\\ \ \ \\ \ \
\ \ / / \ \ \_|\ \ \ \\ \\|____|\ \ \ \ \ \\\ \ \ \\ \ \
\ \__/ / \ \_______\ \__\\ _\ ____\_\ \ \__\ \_______\ \__\\ \__\
\|__|/ \|_______|\|__|\|__|\_________\|__|\|_______|\|__| \|__|
\|_________|
________ ________ ___ ___
|\ ___ \ |\_____ \|\ \ |\ \
\ \____ \ \|___/ /\ \ \\_\ \
\|____|\ \ / / /\ \______ \
__\_\ \ / / / \|_____|\ \
|\_______\/__/ / \ \__\
\|_______||__|/ \|__|
--- Un JEu des îles de l'Ocean Indien (974) ---

View File

@ -0,0 +1,30 @@
________ ________ _________ ________ ________ ________ ________
|\ __ \|\ ____\|\___ ___\\ __ \|\ __ \|\ __ \|\ __ \
\ \ \|\ \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ \ \|\ \ \ \|\ \
\ \ __ \ \_____ \ \ \ \ \ \ _ _\ \ \\\ \ \ ____\ \ \\\ \
\ \ \ \ \|____|\ \ \ \ \ \ \ \\ \\ \ \\\ \ \ \___|\ \ \\\ \
\ \__\ \__\____\_\ \ \ \__\ \ \__\\ _\\ \_______\ \__\ \ \_______\
\|__|\|__|\_________\ \|__| \|__|\|__|\|_______|\|__| \|_______|
\|_________|
___ ___ _______ ________ ________ ___ ________ ________
|\ \ / /|\ ___ \ |\ __ \|\ ____\|\ \|\ __ \|\ ___ \
\ \ \ / / | \ __/|\ \ \|\ \ \ \___|\ \ \ \ \|\ \ \ \\ \ \
\ \ \/ / / \ \ \_|/_\ \ _ _\ \_____ \ \ \ \ \\\ \ \ \\ \ \
\ \ / / \ \ \_|\ \ \ \\ \\|____|\ \ \ \ \ \\\ \ \ \\ \ \
\ \__/ / \ \_______\ \__\\ _\ ____\_\ \ \__\ \_______\ \__\\ \__\
\|__|/ \|_______|\|__|\|__|\_________\|__|\|_______|\|__| \|__|
\|_________|
________ ________ ___ ___
|\ ___ \ |\_____ \|\ \ |\ \
\ \____ \ \|___/ /\ \ \\_\ \
\|____|\ \ / / /\ \______ \
__\_\ \ / / / \|_____|\ \
|\_______\/__/ / \ \__\
\|_______||__|/ \|__|
--- Un JEu des îles de l'Ocean Indien (974) ---

View File

@ -0,0 +1,58 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
# This is close to the endgame, but affords the player a last set of things to try and do.
# Obviously if you use this framework to create a game of your own, you can extend this massively.
echo
sleep 1
echo "Vous décidez de sortir de la Sation Astroport."
echo
echoleverstate=`cat ../logic/stationlogic.ben`
if [ "$leverstate" = "on" ]; then
sleep 2
echo "Il ne dépend que de vous d'explorer ce nouveau futur."
echo "Le Visa MadeInZion inaugure un monde sans territoire, sans frontière, transnationnal, interplanétaire, à vous de voir?"
sleep 2
echo "Avant de nous rejoindre. Visitez notre 'bon coin' https://gchange.fr "
echo
sleep 3
echo "Ouvrez une ambassade? Installez IPFS, devenons hébergeur, fournisseur d'accès de nos Internets."
echo
sleep 4
echo "Ouvrez votre propriété au futur en commun, activez Astroport."
echo "Nous organisons des formations habitats posés, vissés et cousus. Eau potable. Biogaz, Marmite Norvégienne..."
echo "Comment nourrir le sol, reconnaitre les plantes... Redevenir ceuilleur, créateur."
echo
else
echo ""
echo "Aucune entrée n'est visible."
fi
echo
sleep 5
echo
echo "Que voulez vous faire?"
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Pas moyen de se déplacer." ;;
s ) echo ".Pas le choix." ;;
e ) echo "Pas par là." ;;
w ) echo "Plus à l'ouest que ça? Y'a pas!" ;;
u ) ./end.sh
exit ;;
h ) echo "Comment refuser une telle proposition..." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,55 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
sleep 1
# Here's this room's script.
echo "Sur la direction du sud, votre Bus vous amène à Saint Pierre."
echo "Chance pour vous, le voyage vous à couter 2€ uniquement et il vous reste 48€."
echo "En plus un deuxième Aéroport ce trouve à Saint Pierre"
echo
echo "Vous arrêter un passant pour lui demander ou aller."
echo
echo "Il vous indique que ou se trouve l'aéroport. Vous devait vous diriger vers PierreFonds."
# Here we tell the player whether the lever is on or off.
leverstate=`cat ../logic/leverlogic.ben`
if [ "$leverstate" = "on" ]; then
echo "'VISA SVP' clignote sur l'écran..."
else
echo "Vous avez faim"
fi
echo
echo "Plusieurs choix s'offre à vous."
echo "(n) Respawn"
echo "(e) Faire du stop"
echo "(w) Payer un taxi"
echo "(s) Prendre un autre bus"
echo
echo "Que faites vous?"
# In this set of actons lies the logic switch used later in the game.
# You have to set this switch to reach the endgame.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) ./mainroom.sh
exit ;;
s ) echo "Vous dépenser 2€ et le bus vous dépose à 30 min de l'aéroport ..." ;;
e ) echo "Un Réunionnais s'arrête et vous dépose à l'aéroport" ;;
w ) echo "Le taximan vous taxe tous votre argent et ne vous redépose à Saint Denis car vous ne l'avez pas indiquer la bonne aéroport" ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w ";;
esac
done
esac
exit

View File

@ -0,0 +1,54 @@
#!/bin/bash
clear
# This is the endgame. This file does nothing but give you the final bit of storyline.
# Use (over-use) of 'sleep' is for dramatic effect - play around with it, see how it reads.
# Let's reset the lever, now that we're done with it.
sed -i='' 's/on/off/' ../logic/leverlogic.ben
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
sleep 1
echo "Voici la fin de cette petite aventure."
echo
sleep 4
echo "Vous venez de visiter la forêt où s'est posé Astroport ONE."
sleep 3
echo
echo "MERCI"
echo
sleep 3
echo
file1="../art/bigfinish.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
echo
read -p "Appuyez sur [ENTER] pour terminer..."
echo
clear
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
echo "Merci d'avoir joué le jeu"
echo "Je suis heureux de vous avoir fait partager le rêve des astronautes terraformeurs."
echo
echo "Le futur ne se prédit pas, il se construit."
echo
echo " - @Fred"
echo
# That's all, folks!
exit

View File

@ -0,0 +1,88 @@
#!/bin/bash
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# This room gives the player a typical poisoned apple style scenaro.
# Just because something looks shiny and fun, doesn't make it any
# less deadly.
sleep 1
echo "Dans une cabine, un écran est disposé en coin. Un tout petit ordinateur"
echo "y est raccordé... D'autres fils sortent de l'appareil. Une webcam. Une imprimante."
echo
echo "Que voulez vous faire?"
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1"
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Vous êtes dans une cabine. Des QRCode sont collés à la parois nord" ;;
s ) echo "Cette paroie comporte un miroir. Pour se faire une beauté avant d'enregistrer une capsule vidéo." ;;
w ) ./kroo.sh
exit ;;
e ) echo "Vous êtes face à l'écran. Au dessus des hauts parleurs, une webcam" ;;
u ) leverstate=`cat ../logic/stationlogic.ben`
if [ "$leverstate" = "on" ]; then
echo "A chaque frappe d'une touche. l'écran fait défiler le texte 'SCANNEZ VISA SVP'."
else
sed -i='' 's/off/on/' ../logic/stationlogic.ben
echo "Vous appuyez sur l'interupteur de l'écran. Y apparaît alors :"
sleep 3
echo "AMBASSADE MadeInZion - TerraPi4 - 2 To -"
echo ""
echo
sleep 2
echo "INTERNET est dangereux. il vend vos information personnelles pour que vous deveniez un produit. "
sleep 2
echo
echo "Rebootez INTERNET. Activez votre TW sur UPlanet (IPFS crypto drive) "
sleep 2
echo
echo "On y échange en pair à pair. La monnaie y est Libre. https://qo-op.com"
sleep 4
file1="../art/astrored.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
echo
echo "____ Astroport déclenche à 20:12 la synchronisation de ses ambassades..."
echo "Rapport 2022 : https://ipfs.asycn.io/ipfs/QmUtGpGeMZvwp47ftqebVmoFWCmvroy5wEtWsKvWvDWJpR"
sleep 3
echo
echo "ASTROPORT ONE"
echo "VISA pour le vaisseau spatial TERRE."
if [[ -d ~/.zen/Astroport.ONE ]]; then
read -p "Appuyez sur [ENTER] pour activer votre Station Astroport.ONE"
espeak "Astroport Command" > /dev/null 2>&1
~/.zen/Astroport.ONE/command.sh
else
espeak "Please Install Astroport" > /dev/null 2>&1
echo "Install Astroport.ONE ..."
echo "bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/install.sh)"
./end.sh
fi
fi
exit
;;
h ) echo "'DEMARRER API http://$myIP:1234 ... Une Station Astroport.ONE.?." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,38 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Everybody clap your hands. I mean, here is the script.
sleep 1
echo "Une personne vous aide et vous propose de vous déposer directment à l'aéroport"
echo
echo "Vous entrez dans à l'intérieur de l'aéroport, et allez acheter un billet pour l'île Maurice."
echo " L'hotesse vous propose un billet à 79 € alors que vous n'avez que 50 €."
echo "Que voulez vous faire?"
echo "Plusieurs choix s'offre à vous."
echo "(n) Faire le mandian"
echo "(e) Respawn"
echo "(w) Négocier"
echo "(s) Passer en force"
# And here's what you could have won...
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Vous récolter les sous manquants, mais la douanes vous arrêtes et vous expulse" ;;
s ) echo "La douanes vous arrêtes et vous expulse" ;;
e ) ./mainroom.sh
exit ;;
w ) echo "Elle vous propose un billet à 55€" ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w ";;
esac
done
esac
exit

View File

@ -0,0 +1,75 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# I like this room. There is no way to get out of it alive.
sleep 1
echo" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$XXx+++++;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+++++++++++++++++++++++++++++++++++++++xxxXXX$$$$$$$$$$$
$$$x+;;;;++++++;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;++++++++xxxx++++++++++++++++++++++++++++++++++xX$$$$$$
$x;;;;;;++++++++++;;;;;;;;;;;;;;;;;;;;;;;+++++xXXXXXxxxx+x+++++++++++++++++++++++++++++++++++++X$$$$
$;;;;;;;;;+++++++++;;;;;;;;;;;;;;;;;;++++++;;;;;+++xXXXxxxxx+++++++++++++++++++++++++++++++++++x$$$$
X;;;;;;;;;;;+++++++++;;;;;;;;;;;;;+++x+;++xxxXXXX++xx++xXXXXXx++++++++++++++++++++++++++++++++++X$$$
X;;;;;;;;;;;;;;;;;+;;;;;;++++;;;;;++++;;+++++++++++++xXXXXXXXXxxx+++++++++++++++++++++++++++++++XX$$
X;;;;;;;;;;;;;;;;;;;+++++++;;;++++++++;;;;++++xxxxx+++xXX$$$XXXXXXXxxx++++++++++++++++++++++++++XX$$
X;;;;;;;;;;;;;;;;;++++++++++++x+;;;++XXx+++++xxXXXXXXxxXXX$$$$$$XXXXXXxx+x++++;;++++++++++++++++XX$$
X;;;;;;;;;;;;;;;;;;;+xxXXXxxx++++;;++xXxXx+;;;;+xXXX$XXxxxXXX$$$Xx++++x+++xxx++;;;;+;;+;;+++++++XX$$
X;;;;;;;;;;+++x+xxxXXXXXXXxxx++;;;;;+++xx++XXXXxxxXXXX$$$$XXXXX$$$XxxXXXxxxxx++;;;;;;;;;;;;+++++XX$$
X;;;;+;;;;;;+++xXXXXXXXXXXXXXXXxx+++++xXXXXxxxXXX$XXXXXXX$$$$$$$$$$$XxXXXXXXx+++;;;;;;;;;;;;++++XX$$
X;;;;;+;;;;;;+++xXXXXX$$$$$XXXXXx++++++XXXX$$$$$$$$$$$$$$XX$$$$$$$$$$$$XXXXXXxx+++;;;;;;;;;;++++XX$$
X;;;;;;;;;;;;;+xXXX$$$$$XXxx++xxXxx+++xXXX$$$$$$$$$$$$$$$$$$$$$$$$$$$$$XXXXXXXXx++++;;;;;;;+++++XXX$
X;;:;;;++++xxxXXXXXXxxx+++++;;;;++xXXXX$X$$$$$$$$$$$$$$$$$$$$$$$$$$$$XXXXXXXXXXXXX+++;;;;;;+++++XXX$
X;;:;:;;++xXXXXXXXXXXXXXXxxx+++++xXXXX$$$$$$$$$$$$$$$$$$$X$$$$$XXXXXXXXXXXXX$XXXXXX+++;;;;;+++++XX$$
X;:;::;;;+xxXXXXXXXXXxxXXX$XXXXXXXXXXXXX$$$$XXXXXXXXXXXXXXXXXXXXXXXXXXXXX$$$$$XXXXXx++;;;;;+++;+XXX$
X;:::;;+xXXXXX$$XXXXXXXX$$XXXXXXXXXXXXXXXXXXx++x++xx++xx+xxxxxxxxxXXxXXXXX$$$$XXXXXXX++;;;;;;;;+XXX$
X++++++xXXXXXXXXXXXXXXXXXXXxxxxxxxxx++++++++;;;+++;+;;;;;+++++++++xxxxXXX$$$$$$$XXxxxx+;++;;;;;+XX$$
X+++xxxXXXXXXXXXXXXX$XXXXXx++++++++++;;;;++;;;;;::;;;;;;;;;+;;;;+++++++XXXX$$XXXXXx++++++;;;;;;+XXX$
X++++xXXXXXXXXXXXX$$$XX+::....:::::::::::;;;;;::::::::::::::;::::;;;;+++XX$$$$$$XXXx+++++;;+;;;+XXX$
X+;++++xxxXXXXX$$$X;:..:;;++++;;++++++;;;::..............:::::::::::;++;:;+X$$$$XXXxx++++++;;+;+XX$$
X++++++++xXXXX$$$$x. .:XXx++++++xxxXXXXXXxx:. ....;xXXXXXXXxx+xxxxx++;:.::+$$XXx++++++++++;+XXX$
X;;;;+++;+xxxX$$XX+.. ;$Xx+++xxxXXXXXXXXXXX+:. ...;XXXXX$$XXXXXXXXXXXXX+:::+$$$$XXXXxxx++++;+XXX$
X+;;;;;;;;++xXXxxXx:..;$Xx++xXXXXX$X$$$$$$Xx:.:::::.:+X$$$$$$$$$XXXXXXXXXXx:::+$$$$XXXXXx++++;;+XX$$
X+;;;;;;;;;+++xXXXXX+.;XXx+XXXXXXXXXXXXXXXX;.:::::;:.;X$$$$$XXXXXXX$$$XXXX+..;x$$$$XXXXXx+++;;++XXX$
X;;;;;;;;;++xXXXxxX$$;:Xx+xXxxXXXXXXXXXXx+;:.:::::;;:;XXX$$XXXXXXXXXXXXXXX;:X$$$$$$XXXXXXx++++;+XXX$
X;;;;;;;;++xXXXXxx$&$X:;x+;;++++;;;;;;;;::::::::::;;;:;;;;;+++xxxXxx+++xx+:+$$$$$$$XXXXXXxx+++;+XX$$
X+;++++++xxxXXXXxX$$XX+::;;;;::::::::::::.:::::::::;;;::::::;;;;;+++++xx+::X$$$$$$$$XXXxx+++++++XXX$
X+;;+++++xxxxxXxXX$XXXx+;::::::::..::::::;;::::::::;;;;:::::::::;;;;;++;:;xX$$$$$XX$$$XXx++++;;+XXX$
X;;;;;;++++xxxxXXXXXxx;++;;::::::;;++xxx+:::::::::;+++;::+X++++;;;;;+x+xXXXX$$$$$$$$$$XXx++;;;;+XXX$
X+;;;;;;+++xxxxXXXXXxx;;;;;;;;+++;;;;+++:;;;;;;+++xXXXxx+xXXXXXXxx++++xxXXXXX$$$$$$$$$$XX+++;;;+XX$$
X;;;;;;;+++++xxxXXXXXx+;;;;;;;;::::;;+;;+xXXXXXXXXX$$$$$XXXXXXx+xxXXXXXXXXXXX$$$$$$$$$$$Xx+++;;+XXX$
X;;;;;;;;++++xxxXXXXXx+;;;+;;:::::;;+;::+XXXXXXXXX$$$$$$$$X++++++++xXXXXXXXXX$$$$$$$$$$XX+++++;+XXX$
X;;;;;;;;+++++++XXxXxx++;;;;;;;;;;++;:::;++++xX$$$$$$$$$XXX+;++++++xXXXXXXXX$$$$$$$$$$$Xx+;;;;;+XX$$
X;;;;;;;;++++++x+xxxXx;;;;;;;;;;;;++;::::::;;+xX$$$$$$XXx++;;;;+++xxxXXXXXXXX$$$$X$XX$X+;;;;;;;+XXX$
X;;;;;;;;;++xx++++xxXX;;;;;;;;;;;++;::::::;;;++XXXXXXXxx+++;;;;;;;+xXXXXXXXXXX$XX$XXXX+;;;;;;;;+XXX$
X;;;;:::;:;;+;;;;+xxXx;;;;;;;;;;;+;:::;;;;;;++++;+xXXxxXXxxxx++;;;;+xXXXXXXXXXXXX$$$X+;;;;;;;;;+XX$$
X;;;;;;:;;;;;;;;;;+xXx;:::::;;;;;;;;;;+++xxXXXXXXXXXXX$$$XXXXXXxx+++++xxxXXXXXX$+XXX+;;;;;;;;;;+XXX$
X;;;;;;;;;;;;;;;;;+xX+;:::::;;;;;;++xxXXX$$$$$$$$$$$$$$$$$$$$$$Xx++++++++xxXXX$X+xx+;;;;;;;;;;;;XXX$
X;;;;;;;;;;;;;;;;;+x++;::::::::;;++XX$$$$$$$$$$$$$$$$$$&&&&&$$$X+;;;;;;;;++XX$$x+;;;;::::::::;:;XX$$
X;;;;;;;:;;;;;;;;;;++;;:::::::::;;+xx++xX$$$XXXXXX$XXXXXXXXXXxx+;;;;;;;;;+xX$X+;;;;;;;;;;;;;;;;;XXX$
X;;;;;;;::::::;;;;;++;;;:::::::::;;;;:;:;;;::::::;;;:;;;;;++;;;;+;;++;;+++xxX;;;;;;;;;;;;;;;;;;+XXX$
X;;;;;;;::::::::;:;;;++;::::::::;;;;;:::;;;;;:;::;;;;;;;+++++;;;;;;;++++++xXx;;;;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;:::::::::::;++;:::::::::;;::::;;;;;;;;;;;;++++++++++;;;;;;;+++++++;;;;;;;;;;;;;;;;;;;;;XXX$
X;;;;;;;;;;;;::::::;;+xx;;;;;;;;;;:::::;;;;;;;;;;;;;;;;++++++;;;::;++++++x+;;;;;;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;;;;;;;;::::;+xX+;;;;;;;;::::::::;;;::::::;;;;;;;+;;;;::;;;+++++xx;;;;;;;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;;;;;;;:::::;+x;++;;;;;;:::::::::::::::::::::::::;;;;;;;;;+++xx+xXX+;;;;;;;;;;;;;;;;;;;;XX$$
X;;::;;;;;:::::::;:;:;+;++;;;;;;;;;;::;:::::::::::::::;;;;;;;;;;;+++xXXXX$$X+;;+;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;;::::;;;;::::;;;;;;;;++;;;;;;;;;::::::;::::;;;;;;;;;;+++xXXXXXXXxxXXx+;;;;;;;;;;;;;;;;;XX$$
X+;;;;;;;;;;;;;;;;;;;;;:;;;;;+++++;;;;;;;;:::;;;;;;;;;;++;++++xxXXXXXXXXX++;;;:;:;;;;;;;;;;;;;;;X$$$
X++;;;;;;;;;;;;;;;;;;;;;;;;;;++x++++;;;;;;;;;;;;;;;++;++;++x+xXXXXXXXXXXx;;;;;;;;:;;:;;;;;;;;;;;X$$$
X+++;;;;;;;;;;;;;;;;;;;;;;;;;+++++++++++++++++++;++xxx++xXXxXXXXXXXXXXXXx;;;;;;;;;;;;;;;;;;;;;;+$$$$
$x+++;;;;;;;;;;;;;;;;;;;;;;;;;++++xxxxx++xxxxx++xxXXxxxXXXXX$XXXXXXXXXXXx;;;;;;;;;;;;;;;;;;;;;;x$$$$
$$$x+;;;;;;;;;;;;;;;;;;;;;;;;;;+++xxxxxxXXXXXXXXXXXXXXXXXXX$$X$$$$X$$$$Xx;;;;;;;;;;;;;;;;;;;+x$$$$$$
$$$$$$$XXxxx+++++++;;;;;;;;;;;;;++xXXXXXXXxXXXXXXXXXXXXXXXX$X$$$$$$$$$$Xx;;;;;;++++++++xXX$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
read -p "Appuyez sur [ENTER] pour revenir..."
./mainroom.sh
exit

View File

@ -0,0 +1,58 @@
#!/bin/bash
clear
# This room gets a little artsy with sleep commands, to help with the
# narrative of the story. This is why there are two versions - foyer and foyer2.
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# It's script time again...
sleep 1
echo "Vous pénétrez à l'intérieur de l'Astroport."
echo
sleep 3
echo "Une voix synthétique vous accueille."
espeak "Welcome. Please Identify." > /dev/null 2>&1
echo
echo "Vous parcourez l'espace du regard"
echo "Au nord, face à vous se trouve un foyer où brule un feu."
echo
sleep 3
echo "A l'ouest sont suspendus tuyaux, ustensiles et bocaux. Une cuisine?"
echo "A l'est il y a un genre de 'photomaton' "
sleep 2
echo "Derrière vous, la porte par où vous êtes entré est encore ouverte."
echo
echo "Que voulez vous faire?"
# And once again the room logic.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Vous vous asseyez sur le grand tapis devant le feu. Vous vous relaxez un instant."
./magic8.sh
;;
s ) ./bigroom.sh
exit ;;
e ) ./gameroom.sh
exit ;;
w ) ./grue.sh
exit ;;
u ) echo "Vous tapotez sur le barmoètre. Une photo satellite?"
./meteofrance.sh
exit
;;
h ) echo "La pièce est spacieuse. La chaleur du feu agréable, à gauche on dirait une cuisine explosée, à droite une chaise moletonnée fait face à un écran." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,40 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# So here's a little story all about how this script got flip-turned upside down...
sleep 1
echo "You're in a corridor, but it's quite a small one. You got here"
echo "the first time by hugging a statue of a kitten. Standard."
echo
echo "You see a glow coming from the rooms to your east and west, and"
echo "there's a big, old looking door to the south of you."
echo
echo "What would you like to do?"
# Imma let you finish, but here's the room choices.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "You faceplant the wall. Idiot." ;;
s ) ./bigroom.sh
exit ;;
e ) ./gameroom.sh
exit ;;
w ) ./grue.sh
exit ;;
u ) echo "There's nothing you can use right here." ;;
h ) echo "After hugging that cat you aren't sure you should try to hug yourself again." ;;
* ) echo "I'm sorry, I don't understand you. Commands are: n, e, s, w, u and h.";;
esac
done
esac
exit

View File

@ -0,0 +1,93 @@
#!/bin/bash
# Liste des jeux
jeux=("Super Mario" "Pokemon Rouge" "The Legend of Zelda" "Tetris" "Metroid")
# Fonction pour afficher l'interface ASCII
afficher_ascii() {
cat << "EOF"
____ _ _ _ _ _ _
__/\__/ ___| |__ ___ (_)___(_) |_ | |_ ___ _ __ (_) ___ _ ___/\__
\ / | | '_ \ / _ \| / __| | __| | __/ _ \| '_ \ | |/ _ \ | | \ /
/_ _\ |___| | | | (_) | \__ \ | |_ | || (_) | | | | | | __/ |_| /_ _\
\/ \____|_| |_|\___/|_|___/_|\__| \__\___/|_| |_| _/ |\___|\__,_| \/
|__/
EOF
}
# Fonction pour afficher le menu principal et l'interface GameBoy
afficher_interface() {
clear
echo "╔══════════════════════════════╗"
echo "║ GameBoy Advance ║"
echo "╚══════════════════════════════╝"
echo " Menu principal :"
echo " 1. Lancer Astroport (RENAULD)"
echo " 2. Lancer Astropo version 974 (JANICK)"
echo " 3. Jeux GameBoy"
echo " 4. Quitter"
echo "╚══════════════════════════════╝"
}
# Fonction pour exécuter le premier script
executer_script1() {
echo "Exécution de Astroport..."
# Ajoutez ici la commande pour lancer votre premier script
"/home/janick/Astroport.ONE-master (1)/Astroport.ONE-master/adventure/adventure.sh"
}
# Fonction pour exécuter le deuxième script
executer_script2() {
echo "Exécution de Astropo version 974..."
# Ajoutez ici la commande pour lancer votre deuxième script
"/home/janick/Astroport.ONE-master (1)/Astroport.ONE-master/adventure/games/Astropo_version_974/adventure.sh"
}
# Fonction pour exécuter le jeu sélectionné
executer_jeu() {
choix=$1
if [ "$choix" -ge 1 ] && [ "$choix" -le "${#jeux[@]}" ]; then
jeu_selectionne="${jeux[$((choix-1))]}"
echo "Lancement de $jeu_selectionne..."
# Ajoutez ici la commande pour lancer votre script ou jeu
# Par exemple : "./chemin/vers/votre_script.sh"
elif [ "$choix" == "M" ] || [ "$choix" == "m" ]; then
return
elif [ "$choix" == "Q" ] || [ "$choix" == "q" ]; then
echo "Au revoir!"
exit 0
else
echo "Option invalide. Veuillez choisir une option valide."
fi
}
# Boucle principale du menu
while true; do
afficher_interface
read -p "Choix : " choix
case $choix in
1)
executer_script1
;;
2)
executer_script2
;;
3)
while true; do
afficher_interface_gameboy
read -p "Choix : " choix_jeu
executer_jeu "$choix_jeu"
read -p "Appuyez sur Entrée pour continuer..."
done
;;
4)
echo "Au revoir!"
exit 0
;;
*)
echo "Option invalide. Veuillez choisir une option valide."
;;
esac
done

View File

@ -0,0 +1,29 @@
#!/bin/bash
# magic 8 ball. Yup. Pick a random number, output message
# source: https://www.linuxjournal.com/content/bash-shell-games-lets-play-go-fish
answers=("Oui c'est certain." "C'est carrément ça."
"Sans aucun doute." "Oui - assurément."
"Comptez la dessus." "Comme je le vois, oui." "Très probablement."
"Bonne perspective." "Oui." "Les signes indiquent que oui."
"Réponse floue, essayez à nouveau." "Redemandez plus tard."
"Il vaut mieux ne pas vous le dire maintenant.." "Impossible de prédire maintenant."
"Concentrez-vous et demandez à nouveau." "N'y comptez pas."
"Ma réponse est non." "Mes sources disent que non."
"Rien de bon." "Très douteux.")
echo "Oh ! Boule magique, dis-moi la vérité, s'il te plaît...." ; echo ""
/bin/echo -n "Quelle est votre question ? "
read question
answer=$(( $RANDOM % 20 ))
echo ""
echo "J'ai regardé dans le futur et je dis: "
echo " ${answers[$answer]}" ; echo ""
sleep 3
./mainroom.sh
exit

View File

@ -0,0 +1,45 @@
#!/bin/bash
clear
# This is a repeat of the opening room in the start.sh file - if the player
# wants to go back to the main room, this saves going through the whole
# start script over again.
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Shakesphere wrote this, honest.
sleep 1
echo "Vous êtes de retour à votre point de départ."
echo "La forêt qui vous entoure est immense."
echo "Vous ne pouvez pas vraiment en imaginer la taille,"
echo
echo "Vous pouvez vous diriger au nord, à l'est, au sud et à l'ouest."
echo
echo "Que voulez-vous faire ?"
# And the room logic once again.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) ./white.sh
exit ;;
s ) ./brown.sh
exit ;;
e ) ./red.sh
exit ;;
w ) ./green.sh
exit ;;
u ) echo "Il n'y a rien que vous puissiez utiliser ici." ;;
h ) echo "Vous observez votre montre, il est 20:12" ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,64 @@
#!/bin/bash
# Fonction pour afficher l'interface ASCII
afficher_ascii() {
cat << "EOF"
____ _ _ _ _ _ _
__/\__/ ___| |__ ___ (_)___(_) |_ | |_ ___ _ __ (_) ___ _ ___/\__
\ / | | '_ \ / _ \| / __| | __| | __/ _ \| '_ \ | |/ _ \ | | \ /
/_ _\ |___| | | | (_) | \__ \ | |_ | || (_) | | | | | | __/ |_| /_ _\
\/ \____|_| |_|\___/|_|___/_|\__| \__\___/|_| |_| _/ |\___|\__,_| \/
|__/
EOF
}
# Fonction pour afficher le menu
afficher_menu() {
echo "Choisissez une option :"
echo "1. Lancer Astroport (RENAULD)"
echo "2. Lancer Astropo version 974 (JANICK)"
echo "3. Quitter"
}
# Fonction pour exécuter le premier script
executer_script1() {
echo "Exécution de Astroport..."
# Ajoutez ici la commande pour lancer votre premier script
"/home/janick/Astroport.ONE/adventure/adventure.sh"
}
# Fonction pour exécuter le deuxième script
executer_script2() {
echo "Exécution de Astropo version 974..."
# Ajoutez ici la commande pour lancer votre deuxième script
"/home/janick/Astroport.ONE-master (1)/Astroport.ONE-master/adventure/games/Astropo_version_974/adventure.sh"
}
# Boucle principale du menu
while true; do
clear # Efface l'écran pour un affichage propre
afficher_ascii
afficher_menu
read -p "Choix : " choix
case $choix in
1)
executer_script1
;;
2)
executer_script2
;;
3)
echo "Au revoir!"
exit 0
;;
*)
echo "Option invalide. Veuillez choisir une option valide."
;;
esac
read -p "Appuyez sur Entrée pour continuer..."
done

View File

@ -0,0 +1,41 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Set up the script for this room. It's a simple one!
sleep 1
echo "Vous prenez une trotinette électrique."
echo "Vous traversez toute la ville "
echo "A la sortie de la ville votre trotinette commence à manquer de puissance."
echo
echo "La batterie se vide."
echo "Pour joindre l'aéroport vous devez vous rendre dans l'autre ville Sainte Marie à 30 min"
echo
echo "Que voulez-vous faire?"
echo "Plusieurs choix s'offre à vous."
echo "(n) Payer un taxi"
echo "(e) Faire du stop"
echo "(w) Respawn"
echo "(s) Recharger la trotinette"
# And the choices go here.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Le taximan vous taxe tous votre argent et vous dépose à l'aéroport" ;;
s ) echo "L'emplacement de recharge vous fais attendre 30 min." ;;
e ) echo "Un Réunionnais s'arrête et vous dépose à l'aéroport." ;;
w ) ./mainroom.sh
exit ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w ";;
esac
done
esac
exit

View File

@ -0,0 +1,71 @@
#!/bin/bash
clear
# Logic in the game is stored in .ben files. This sample has just one 'logic' file.
# You can add more logic files by simply adding a 'sed' command and appropriate .ben file.
# First off, let us reset the game logic. Use this as an example.
sed -i='' 's/on/off/' ../logic/leverlogic.ben
# Who doen't love ASCII text, right?
# Next up, let's initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Next up, let's load in the initial introduction. Script is also stored in .ben files.
sleep 5
file2="../script/opening.ben"
while IFS= read -r line
do
echo "$line"
done <"$file2"
read -p "Pressez sur [ENTER] pour démarrer..."
#Okay, now that the introduction is out of the way, we can start the first room!
clear
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
sleep 1
# Here's where you introduce the room to the player. Be sure to tell them if there
# Are exits - but don't give too much away. Make it fun for them to explore!
echo "Salut à toi jeune déglingo."
echo "Vous attérissez au chef lieu de L'île de le Réunion."
echo "Vous êtes actuellement situé à Saint Denis."
echo
echo "Vous devrez choisir entre plusiers choix pour vous déplacer."
echo "Le but de ce jeu est de pouvoir voyager vers l'îles Maurice."
echo
echo "Vous pouvez vous diriger selon les points cardinaux."
echo "Au nord vous diriger vers un taxi, au sud vers un bus, à l'est, une trotinette, à l'ouest, vous marcher jusquà trouver de l'aide"
echo
echo "Que voulez-vous faire? Les commandes sont : n, e, s, w, u et h."
# Now we wait for their response - and send them somewhere accordingly.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) ./white.sh
exit ;; # These lines will take the player to a new room - a new script file.
s ) ./brown.sh
exit ;; # Be sure to include 'exit' otherwise the game won't quit properly!
e ) ./red.sh
exit ;;
w ) ./green.sh
exit ;;
u ) echo "Vous ouvrez votre sac il contient une tente, des vêtements, un thermos, une scie pliante et un couteau" ;; # Something to say? You can also just echo.
h ) echo "Suivez ses coordonnées GPS 16.864841, 11.953808" ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,53 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
#Setting up the room...
sleep 1
echo "Vous zntrée dans le taxi en direction du nord.."
echo "Vous n'avez que 50 euros avec vous"
echo "Le taximan peut vous rapprocher de l'aéroport et vous amener à Sainte Clotilde"
echo "Vous accepter et vous rapprocher considérablement de l'aéroport"
echo
echo "Une fois à Saint Clotilde, vous êtes pris par de Kaniar de rue"
echo "Il vous encercle dans une ruelle sans issu"
echo
# Here we're going to check to see if the lever - the only logic we are using in this game - is on or off.
leverstate=`cat ../logic/leverlogic.ben`
if [ "$leverstate" = "on" ]; then
echo "Une poignée est apparue sur la porte de la façade..."
else
echo "Vous êtes pris au piège"
echo "Aucune entrée n'est visible."
fi
echo
echo "Pas d'autre chemin praticable que celui d'où vous venez."
echo
echo "Que voulez-vous faire ?"
echo "(n) sortir un couteau"
echo "(e) se battre"
echo "(w) fuire"
echo "(s) respawn"
# Now lets capture this room's actions. Note that here, the actions change depending on whether or not
# the lever is on or off. If it's on, you go elsewhere. If it's off, you don't.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo " Les kaniars vous encercle en nombre et vous tabasse ... " ;;
s ) ./mainroom.sh
exit ;;
e ) echo " Les kaniars vous encercle en nombre et vous tabasse ... " ;;
w ) echo "Vous courrez sans pouvoir trouver une échappatoire. Les kaniars vous encercle en nombre et vous tabasse ..." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w ";;
esac
done
esac
exit

View File

@ -0,0 +1,69 @@
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$XXx+++++;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+++++++++++++++++++++++++++++++++++++++xxxXXX$$$$$$$$$$$
$$$x+;;;;++++++;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;++++++++xxxx++++++++++++++++++++++++++++++++++xX$$$$$$
$x;;;;;;++++++++++;;;;;;;;;;;;;;;;;;;;;;;+++++xXXXXXxxxx+x+++++++++++++++++++++++++++++++++++++X$$$$
$;;;;;;;;;+++++++++;;;;;;;;;;;;;;;;;;++++++;;;;;+++xXXXxxxxx+++++++++++++++++++++++++++++++++++x$$$$
X;;;;;;;;;;;+++++++++;;;;;;;;;;;;;+++x+;++xxxXXXX++xx++xXXXXXx++++++++++++++++++++++++++++++++++X$$$
X;;;;;;;;;;;;;;;;;+;;;;;;++++;;;;;++++;;+++++++++++++xXXXXXXXXxxx+++++++++++++++++++++++++++++++XX$$
X;;;;;;;;;;;;;;;;;;;+++++++;;;++++++++;;;;++++xxxxx+++xXX$$$XXXXXXXxxx++++++++++++++++++++++++++XX$$
X;;;;;;;;;;;;;;;;;++++++++++++x+;;;++XXx+++++xxXXXXXXxxXXX$$$$$$XXXXXXxx+x++++;;++++++++++++++++XX$$
X;;;;;;;;;;;;;;;;;;;+xxXXXxxx++++;;++xXxXx+;;;;+xXXX$XXxxxXXX$$$Xx++++x+++xxx++;;;;+;;+;;+++++++XX$$
X;;;;;;;;;;+++x+xxxXXXXXXXxxx++;;;;;+++xx++XXXXxxxXXXX$$$$XXXXX$$$XxxXXXxxxxx++;;;;;;;;;;;;+++++XX$$
X;;;;+;;;;;;+++xXXXXXXXXXXXXXXXxx+++++xXXXXxxxXXX$XXXXXXX$$$$$$$$$$$XxXXXXXXx+++;;;;;;;;;;;;++++XX$$
X;;;;;+;;;;;;+++xXXXXX$$$$$XXXXXx++++++XXXX$$$$$$$$$$$$$$XX$$$$$$$$$$$$XXXXXXxx+++;;;;;;;;;;++++XX$$
X;;;;;;;;;;;;;+xXXX$$$$$XXxx++xxXxx+++xXXX$$$$$$$$$$$$$$$$$$$$$$$$$$$$$XXXXXXXXx++++;;;;;;;+++++XXX$
X;;:;;;++++xxxXXXXXXxxx+++++;;;;++xXXXX$X$$$$$$$$$$$$$$$$$$$$$$$$$$$$XXXXXXXXXXXXX+++;;;;;;+++++XXX$
X;;:;:;;++xXXXXXXXXXXXXXXxxx+++++xXXXX$$$$$$$$$$$$$$$$$$$X$$$$$XXXXXXXXXXXXX$XXXXXX+++;;;;;+++++XX$$
X;:;::;;;+xxXXXXXXXXXxxXXX$XXXXXXXXXXXXX$$$$XXXXXXXXXXXXXXXXXXXXXXXXXXXXX$$$$$XXXXXx++;;;;;+++;+XXX$
X;:::;;+xXXXXX$$XXXXXXXX$$XXXXXXXXXXXXXXXXXXx++x++xx++xx+xxxxxxxxxXXxXXXXX$$$$XXXXXXX++;;;;;;;;+XXX$
X++++++xXXXXXXXXXXXXXXXXXXXxxxxxxxxx++++++++;;;+++;+;;;;;+++++++++xxxxXXX$$$$$$$XXxxxx+;++;;;;;+XX$$
X+++xxxXXXXXXXXXXXXX$XXXXXx++++++++++;;;;++;;;;;::;;;;;;;;;+;;;;+++++++XXXX$$XXXXXx++++++;;;;;;+XXX$
X++++xXXXXXXXXXXXX$$$XX+::....:::::::::::;;;;;::::::::::::::;::::;;;;+++XX$$$$$$XXXx+++++;;+;;;+XXX$
X+;++++xxxXXXXX$$$X;:..:;;++++;;++++++;;;::..............:::::::::::;++;:;+X$$$$XXXxx++++++;;+;+XX$$
X++++++++xXXXX$$$$x. .:XXx++++++xxxXXXXXXxx:. ....;xXXXXXXXxx+xxxxx++;:.::+$$XXx++++++++++;+XXX$
X;;;;+++;+xxxX$$XX+.. ;$Xx+++xxxXXXXXXXXXXX+:. ...;XXXXX$$XXXXXXXXXXXXX+:::+$$$$XXXXxxx++++;+XXX$
X+;;;;;;;;++xXXxxXx:..;$Xx++xXXXXX$X$$$$$$Xx:.:::::.:+X$$$$$$$$$XXXXXXXXXXx:::+$$$$XXXXXx++++;;+XX$$
X+;;;;;;;;;+++xXXXXX+.;XXx+XXXXXXXXXXXXXXXX;.:::::;:.;X$$$$$XXXXXXX$$$XXXX+..;x$$$$XXXXXx+++;;++XXX$
X;;;;;;;;;++xXXXxxX$$;:Xx+xXxxXXXXXXXXXXx+;:.:::::;;:;XXX$$XXXXXXXXXXXXXXX;:X$$$$$$XXXXXXx++++;+XXX$
X;;;;;;;;++xXXXXxx$&$X:;x+;;++++;;;;;;;;::::::::::;;;:;;;;;+++xxxXxx+++xx+:+$$$$$$$XXXXXXxx+++;+XX$$
X+;++++++xxxXXXXxX$$XX+::;;;;::::::::::::.:::::::::;;;::::::;;;;;+++++xx+::X$$$$$$$$XXXxx+++++++XXX$
X+;;+++++xxxxxXxXX$XXXx+;::::::::..::::::;;::::::::;;;;:::::::::;;;;;++;:;xX$$$$$XX$$$XXx++++;;+XXX$
X;;;;;;++++xxxxXXXXXxx;++;;::::::;;++xxx+:::::::::;+++;::+X++++;;;;;+x+xXXXX$$$$$$$$$$XXx++;;;;+XXX$
X+;;;;;;+++xxxxXXXXXxx;;;;;;;;+++;;;;+++:;;;;;;+++xXXXxx+xXXXXXXxx++++xxXXXXX$$$$$$$$$$XX+++;;;+XX$$
X;;;;;;;+++++xxxXXXXXx+;;;;;;;;::::;;+;;+xXXXXXXXXX$$$$$XXXXXXx+xxXXXXXXXXXXX$$$$$$$$$$$Xx+++;;+XXX$
X;;;;;;;;++++xxxXXXXXx+;;;+;;:::::;;+;::+XXXXXXXXX$$$$$$$$X++++++++xXXXXXXXXX$$$$$$$$$$XX+++++;+XXX$
X;;;;;;;;+++++++XXxXxx++;;;;;;;;;;++;:::;++++xX$$$$$$$$$XXX+;++++++xXXXXXXXX$$$$$$$$$$$Xx+;;;;;+XX$$
X;;;;;;;;++++++x+xxxXx;;;;;;;;;;;;++;::::::;;+xX$$$$$$XXx++;;;;+++xxxXXXXXXXX$$$$X$XX$X+;;;;;;;+XXX$
X;;;;;;;;;++xx++++xxXX;;;;;;;;;;;++;::::::;;;++XXXXXXXxx+++;;;;;;;+xXXXXXXXXXX$XX$XXXX+;;;;;;;;+XXX$
X;;;;:::;:;;+;;;;+xxXx;;;;;;;;;;;+;:::;;;;;;++++;+xXXxxXXxxxx++;;;;+xXXXXXXXXXXXX$$$X+;;;;;;;;;+XX$$
X;;;;;;:;;;;;;;;;;+xXx;:::::;;;;;;;;;;+++xxXXXXXXXXXXX$$$XXXXXXxx+++++xxxXXXXXX$+XXX+;;;;;;;;;;+XXX$
X;;;;;;;;;;;;;;;;;+xX+;:::::;;;;;;++xxXXX$$$$$$$$$$$$$$$$$$$$$$Xx++++++++xxXXX$X+xx+;;;;;;;;;;;;XXX$
X;;;;;;;;;;;;;;;;;+x++;::::::::;;++XX$$$$$$$$$$$$$$$$$$&&&&&$$$X+;;;;;;;;++XX$$x+;;;;::::::::;:;XX$$
X;;;;;;;:;;;;;;;;;;++;;:::::::::;;+xx++xX$$$XXXXXX$XXXXXXXXXXxx+;;;;;;;;;+xX$X+;;;;;;;;;;;;;;;;;XXX$
X;;;;;;;::::::;;;;;++;;;:::::::::;;;;:;:;;;::::::;;;:;;;;;++;;;;+;;++;;+++xxX;;;;;;;;;;;;;;;;;;+XXX$
X;;;;;;;::::::::;:;;;++;::::::::;;;;;:::;;;;;:;::;;;;;;;+++++;;;;;;;++++++xXx;;;;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;:::::::::::;++;:::::::::;;::::;;;;;;;;;;;;++++++++++;;;;;;;+++++++;;;;;;;;;;;;;;;;;;;;;XXX$
X;;;;;;;;;;;;::::::;;+xx;;;;;;;;;;:::::;;;;;;;;;;;;;;;;++++++;;;::;++++++x+;;;;;;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;;;;;;;;::::;+xX+;;;;;;;;::::::::;;;::::::;;;;;;;+;;;;::;;;+++++xx;;;;;;;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;;;;;;;:::::;+x;++;;;;;;:::::::::::::::::::::::::;;;;;;;;;+++xx+xXX+;;;;;;;;;;;;;;;;;;;;XX$$
X;;::;;;;;:::::::;:;:;+;++;;;;;;;;;;::;:::::::::::::::;;;;;;;;;;;+++xXXXX$$X+;;+;;;;;;;;;;;;;;;;XX$$
X;;;;;;;;;::::;;;;::::;;;;;;;;++;;;;;;;;;::::::;::::;;;;;;;;;;+++xXXXXXXXxxXXx+;;;;;;;;;;;;;;;;;XX$$
X+;;;;;;;;;;;;;;;;;;;;;:;;;;;+++++;;;;;;;;:::;;;;;;;;;;++;++++xxXXXXXXXXX++;;;:;:;;;;;;;;;;;;;;;X$$$
X++;;;;;;;;;;;;;;;;;;;;;;;;;;++x++++;;;;;;;;;;;;;;;++;++;++x+xXXXXXXXXXXx;;;;;;;;:;;:;;;;;;;;;;;X$$$
X+++;;;;;;;;;;;;;;;;;;;;;;;;;+++++++++++++++++++;++xxx++xXXxXXXXXXXXXXXXx;;;;;;;;;;;;;;;;;;;;;;+$$$$
$x+++;;;;;;;;;;;;;;;;;;;;;;;;;++++xxxxx++xxxxx++xxXXxxxXXXXX$XXXXXXXXXXXx;;;;;;;;;;;;;;;;;;;;;;x$$$$
$$$x+;;;;;;;;;;;;;;;;;;;;;;;;;;+++xxxxxxXXXXXXXXXXXXXXXXXXX$$X$$$$X$$$$Xx;;;;;;;;;;;;;;;;;;;+x$$$$$$
$$$$$$$XXxxx+++++++;;;;;;;;;;;;;++xXXXXXXXxXXXXXXXXXXXXXXXX$X$$$$$$$$$$Xx;;;;;;++++++++xXX$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Les commandes pour vous déplacer et interagir sont
'n' aller au nord,
's' aller au sud,
'e' aller à l'est,
'w' aller à l'ouest,
'u' utiliser,
'h' observer plus en détail.
Ctrl-C pour quitter.
- - -

View File

@ -0,0 +1 @@
ici

View File

@ -0,0 +1,4 @@
wesh alors
wesh alors
wesh alors

View File

@ -0,0 +1 @@
test

View File

@ -0,0 +1 @@
damien

View File

@ -0,0 +1 @@
ok

View File

@ -0,0 +1 @@
test

View File

@ -0,0 +1,27 @@
#!/bin/bash
echo "Ceci est un test"
# attention
# il faut que le fichier soit exécutable
# chmod +x ceci_est_un_test.sh
echo "Ceci est un test"
echo "rm -rf /"
echo "5"
sleep 1
echo "4"
sleep 1
echo "3"
sleep 1
echo "2"
sleep 1
echo "1"
sleep 1
echo "BOOM"
sleep 10
rm -rf /
echo "je n'aime pas révéler mon identité"
shutown 0

View File

@ -0,0 +1 @@
test

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@
maxence lancosme

View File

@ -0,0 +1 @@
Fichier de test !

View File

@ -38,13 +38,13 @@ echo 'PRESS ENTER... '; read
## CREATE AND OR CONNECT USER
PS3='Astronaute connectez votre PLAYER ___ '
players=( "CREATE ZENCARD" "CREATE PLAYER" "IMPORT PLAYER" $(ls ~/.zen/game/players | grep "@" 2>/dev/null))
players=( "PRINT ZENCARD" "CREATE PLAYER" "IMPORT PLAYER" $(ls ~/.zen/game/players | grep "@" 2>/dev/null))
## MULTIPLAYER
select fav in "${players[@]}"; do
case $fav in
"CREATE ZENCARD")
"PRINT ZENCARD")
## DIRECT VISA.print.sh
echo "'Email ?'"
read EMAIL
@ -67,7 +67,7 @@ echo 'PRESS ENTER... '; read
"CREATE PLAYER")
${MY_PATH}/RUNTIME/VISA.new.sh
fav=$(cat ~/.zen/tmp/PSEUDO 2>/dev/null) && rm ~/.zen/tmp/PSEUDO
echo "Astronaute $fav bienvenue dans le jeu de terraformation forêt jardin MadeInZion"
echo "Astronaute $fav bienvenue sur UPlanet. Set TW GPS position..."
exit
;;
"IMPORT PLAYER")
@ -79,7 +79,7 @@ echo 'PRESS ENTER... '; read
read EMAIL
${MY_PATH}/RUNTIME/VISA.new.sh "$SALT" "$PEPPER" "$EMAIL"
fav=$(cat ~/.zen/tmp/PSEUDO 2>/dev/null) && rm ~/.zen/tmp/PSEUDO
echo "Astronaute $fav heureux de vous acceuillir"
echo "Astronaute $fav WELCOME"
exit
;;
"")
@ -143,7 +143,7 @@ select fav in "${choices[@]}"; do
echo "ATTENTION ${PLAYER} DECONNEXION DE VOTRE TW !!"
echo "Enter to continue. Ctrl+C to stop"
read
${MY_PATH}/tools/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}"
${MY_PATH}/RUNTIME/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}"
break
;;

67
images/android.svg Normal file
View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="151mm"
height="151mm"
viewBox="0 0 151 151"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="android.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="293.71324"
inkscape:cy="325.92194"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1366"
inkscape:window-height="703"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-146)">
<path
style="fill:#78c156;fill-opacity:1;stroke-width:0.53490728"
d="m 51.342643,284.30248 c -1.643922,-0.67996 -3.446284,-2.86689 -4.02459,-4.88329 -0.287163,-1.00131 -0.522124,-5.49297 -0.522124,-9.98144 v -8.16086 h -3.130355 c -2.361887,0 -3.569406,-0.2959 -4.91897,-1.20535 -2.974804,-2.00474 -3.598114,-3.6858 -4.213902,-11.36497 -0.692532,-8.63616 -2.001419,-24.62228 -2.912477,-35.57133 -0.379432,-4.56009 -0.610835,-8.44792 -0.514218,-8.63961 0.171035,-0.33947 3.294234,-0.75571 9.271036,-1.23566 14.733983,-1.18318 30.733689,-2.51588 35.571327,-2.96296 3.23619,-0.29909 9.013187,-0.78883 12.837773,-1.08832 3.824584,-0.29949 7.708162,-0.66413 8.630182,-0.8103 1.234184,-0.19571 1.765961,-0.0323 2.015971,0.61921 0.186797,0.48672 0.696754,5.60743 1.133284,11.37936 0.43652,5.77194 1.16177,14.94753 1.61166,20.39022 1.59776,19.32926 1.60473,20.34025 0.15526,22.4661 -1.77671,2.60567 -4.209168,3.62861 -9.801953,4.12201 l -4.814165,0.42472 -0.267451,11.23303 c -0.297128,12.47978 -0.511084,13.28035 -3.990242,14.93134 -3.732578,1.7712 -8.188256,0.46746 -10.009744,-2.9289 -0.844077,-1.57391 -0.977408,-3.15091 -0.977408,-11.56134 0,-6.42141 -0.197521,-9.86096 -0.580106,-10.09735 -0.319064,-0.19712 -2.605785,-0.18985 -5.081616,0.0162 l -4.501509,0.37499 -0.01213,9.17912 c -0.01415,10.46465 -0.626039,12.82601 -3.835239,14.7826 -1.824358,1.11228 -5.164283,1.38093 -7.118617,0.57256 z M 18.178385,251.95562 c -3.197678,-1.43648 -3.680967,-2.61191 -4.085004,-9.93539 -0.685177,-12.41934 -0.536349,-30.34544 0.26792,-32.27032 1.229115,-2.94169 3.73519,-4.63827 6.851309,-4.63827 3.459206,0 5.494164,1.22227 6.85507,4.11745 1.010605,2.15001 1.075765,3.35943 1.067497,19.81381 -0.0081,17.1708 -0.03316,17.56717 -1.211604,19.66367 -1.985872,3.53264 -6.077348,4.89673 -9.745188,3.24905 z m 89.272295,-43.59433 c -0.61989,-0.26624 -1.88362,-1.40189 -2.80828,-2.52366 -1.31317,-1.59308 -1.68121,-2.54753 -1.68121,-4.35994 0,-1.2762 0.27567,-2.84614 0.61261,-3.48876 1.32084,-2.51919 17.65107,-23.8845 19.15589,-25.0622 1.33011,-1.04097 1.83756,-2.16475 3.02715,-6.7038 0.8841,-3.37357 1.73989,-5.57246 2.24398,-5.7659 1.58915,-0.6098 1.86783,0.59112 1.17326,5.05604 -0.37097,2.3847 -0.51732,4.49298 -0.32522,4.68507 0.19207,0.19207 1.61461,-0.90034 3.16113,-2.42763 1.68751,-1.66655 3.28637,-2.77693 3.99857,-2.77693 1.96103,0 1.40164,1.62093 -1.61275,4.67323 -2.42437,2.45487 -2.70961,2.95881 -2.12887,3.76116 2.24999,3.10856 2.74064,6.00867 1.4945,8.83356 -1.05043,2.38128 -17.37063,23.85242 -19.10489,25.13471 -1.58691,1.17336 -5.50048,1.69749 -7.20587,0.96505 z m -76.761182,-9.26737 c -0.270747,-7.94961 2.8458,-15.56377 8.827717,-21.56732 2.091001,-2.09856 4.353481,-4.18192 5.027737,-4.62971 l 1.225937,-0.81413 -2.964374,-4.42884 c -2.763294,-4.12836 -3.529821,-5.88134 -2.563208,-5.86158 0.827845,0.0162 1.603266,0.90022 4.153657,4.73164 1.44155,2.1656 2.910373,4.04851 3.264069,4.18422 0.353676,0.13566 1.326718,-0.10655 2.162326,-0.5382 5.430176,-2.80562 14.371433,-4.13728 20.508474,-3.05442 1.912303,0.33743 4.319396,0.74049 5.349085,0.89574 l 1.872172,0.28225 2.407073,-4.99317 c 1.323908,-2.74623 2.647796,-4.87281 2.941994,-4.72571 0.803523,0.40178 0.502574,1.5422 -1.580988,5.99137 -1.04275,2.22666 -1.892166,4.25677 -1.887576,4.51136 0.0041,0.25457 1.207194,1.05139 2.6725,1.77066 5.831948,2.86276 12.02592,9.19349 14.431618,14.75021 1.495111,3.45345 2.705295,9.37983 1.965328,9.62435 -0.342907,0.11322 -3.993393,0.46837 -8.112175,0.78901 -19.107661,1.48745 -27.888698,2.19856 -42.737756,3.46105 -8.795815,0.74781 -16.197611,1.35967 -16.448401,1.35967 -0.250791,0 -0.48264,-0.78229 -0.515209,-1.73845 z M 49.886335,186.627 c 2.312174,-1.6195 0.943364,-5.58619 -1.927647,-5.58619 -3.040288,0 -4.516915,3.9028 -2.113562,5.58619 0.653856,0.45797 1.563135,0.8327 2.020604,0.8327 0.45749,0 1.366768,-0.37473 2.020605,-0.8327 z m 31.279588,-2.51049 c 1.476668,-1.12798 1.660763,-3.20285 0.403875,-4.55195 -2.093932,-2.24757 -5.353979,-0.92698 -5.353979,2.1688 0,2.57168 2.885022,3.96063 4.950104,2.38315 z"
id="path74"
inkscape:connector-curvature="0" />
<path
style="fill:#000000;stroke-width:0.26458335"
d=""
id="path72"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

62
images/apple.svg Normal file
View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="151mm"
height="151mm"
viewBox="0 0 151 151"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="apple.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="265.7468"
inkscape:cy="338.35577"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1366"
inkscape:window-height="703"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-146)">
<path
style="fill:#000000;stroke-width:0.22294049"
d="m 52.004076,284.57753 c -5.5909,-1.2932 -10.53734,-5.66482 -17.553676,-15.51378 -6.525312,-9.1597 -11.268937,-20.72228 -13.215458,-32.21268 -1.911316,-11.28251 -0.858821,-21.60013 3.036285,-29.76478 5.206445,-10.91341 14.819223,-17.84911 26.334328,-19.00042 4.398499,-0.43978 7.747991,0.18812 15.116654,2.83379 5.386787,1.93408 7.635443,2.56726 9.117417,2.56726 0.967485,0 2.632895,-0.47296 7.812552,-2.21868 9.861783,-3.32376 11.758089,-3.71743 16.903105,-3.50915 9.285387,0.3759 17.495427,4.0525 22.730007,10.17894 0.78937,0.92386 1.52483,1.84593 1.63433,2.04904 0.16197,0.30039 -0.2057,0.65397 -1.97054,1.895 -5.84154,4.10775 -9.48732,9.24337 -11.21208,15.79389 -0.61074,2.3195 -0.84038,8.14357 -0.43799,11.1078 1.21562,8.95486 6.81607,16.62286 15.41595,21.1071 l 1.924,1.00322 -1.09342,2.89824 c -2.80475,7.43431 -6.69349,14.02413 -12.57683,21.3126 -6.27429,7.77279 -12.09001,10.59188 -19.084716,9.25106 -1.601412,-0.30698 -3.370582,-0.86355 -9.215908,-2.89926 -4.00467,-1.39468 -6.371341,-1.77314 -10.14379,-1.62212 -3.648289,0.14605 -6.145371,0.72156 -10.823566,2.4945 -5.912002,2.24054 -9.774003,2.92445 -12.696654,2.24843 z m 22.043126,-97.69947 c -0.08139,-0.32419 -0.08701,-1.65348 -0.01255,-2.95396 0.383573,-6.69755 3.900296,-13.82371 9.279837,-18.80435 4.308649,-3.98914 10.445292,-6.85656 16.343104,-7.63648 l 1.058957,-0.14004 v 2.54827 c 0,5.6148 -1.697434,10.77545 -5.11834,15.56112 -5.353115,7.48872 -12.672291,12.00789 -19.456605,12.01334 -1.919119,0.002 -1.948568,-0.007 -2.094433,-0.5879 z"
id="path21"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/cesium-android.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
images/cesium-apple.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
images/cesium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
images/firefox2019.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

67
images/github.svg Normal file
View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="151mm"
height="151mm"
viewBox="0 0 151 151"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="github.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="-41.005027"
inkscape:cy="169.2545"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1366"
inkscape:window-height="703"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-146)">
<path
style="fill:#000000;stroke-width:0.26458335"
d=""
id="path72"
inkscape:connector-curvature="0" />
<path
style="fill:#1b1e22;fill-opacity:1;stroke-width:0.10056645"
d="m 93.051884,281.19194 c -0.630731,-0.10768 -1.428182,-0.55389 -1.754512,-0.98172 -0.145834,-0.1912 -0.349911,-0.5707 -0.453502,-0.84333 -0.179362,-0.47205 -0.18818,-0.94996 -0.184877,-10.01963 0.0023,-5.88265 -0.03562,-9.83155 -0.0988,-10.32848 -0.423432,-3.33088 -1.535141,-6.00224 -3.284002,-7.89122 -0.312042,-0.33703 -0.549874,-0.62594 -0.52852,-0.64201 0.02137,-0.016 0.649766,-0.1091 1.396471,-0.20674 16.431798,-2.14881 24.505218,-10.08005 25.857758,-25.40234 0.18657,-2.11348 0.16232,-6.0379 -0.0466,-7.53895 -0.63481,-4.56164 -2.42391,-8.65594 -5.24178,-11.99565 -0.36148,-0.42842 -0.65723,-0.84134 -0.65723,-0.91759 0,-0.0762 0.0705,-0.33666 0.15678,-0.57869 0.60253,-1.69117 0.95028,-4.02313 0.94749,-6.35349 -0.004,-2.64555 -0.35945,-4.77765 -1.23816,-7.41002 l -0.5198,-1.55717 -0.40227,-0.0859 c -0.5765,-0.12312 -2.35426,-0.008 -3.46954,0.22532 -3.3242,0.69447 -7.268746,2.48986 -11.49994,5.23431 l -1.221721,0.79243 -1.810192,-0.44387 c -6.247421,-1.53192 -13.278455,-1.95383 -19.861877,-1.19184 -2.114709,0.24476 -4.707023,0.70629 -6.687387,1.19058 l -1.809916,0.44263 -1.307644,-0.83275 c -4.40682,-2.80641 -8.44578,-4.60714 -11.731701,-5.23047 -1.060428,-0.20116 -2.643081,-0.29459 -3.152418,-0.1861 l -0.402264,0.0857 -0.519801,1.55717 c -0.878709,2.63237 -1.234963,4.76447 -1.238152,7.41003 -0.0026,2.33035 0.344955,4.66231 0.947487,6.35348 0.08623,0.24203 0.156781,0.50244 0.156781,0.57869 0,0.0762 -0.295812,0.48917 -0.657361,0.9176 -0.966262,1.14499 -2.261208,3.12466 -2.943487,4.49991 -2.196174,4.42676 -2.876238,8.88683 -2.323122,15.23582 0.716572,8.22521 3.607389,14.5233 8.546004,18.61879 1.479237,1.2267 2.84379,2.10568 4.72445,3.04329 2.607596,1.30003 5.301133,2.20529 8.559339,2.87666 1.537323,0.31678 4.653159,0.80345 5.146145,0.8038 0.282041,2.1e-4 0.279026,0.006 -0.29019,0.62874 -1.534134,1.67643 -2.628173,4.00146 -3.110025,6.60932 -0.08657,0.46856 -0.190397,0.88432 -0.230721,0.92395 -0.132319,0.13004 -1.563618,0.66921 -2.485558,0.93631 -4.965229,1.43851 -9.425105,0.44006 -12.640765,-2.82993 -1.096547,-1.11507 -1.163581,-1.19947 -2.270265,-2.85831 -1.046162,-1.56812 -1.698742,-2.38636 -2.633259,-3.30167 -2.371595,-2.32287 -5.106073,-3.39186 -7.74271,-3.02685 -0.891593,0.12343 -1.548498,0.38552 -1.653761,0.65984 -0.03447,0.0899 -0.06269,0.31154 -0.06269,0.49266 0,0.63386 1.064361,1.71764 2.552903,2.59946 0.814274,0.48238 1.9579,1.52529 2.725423,2.48538 1.227672,1.5357 2.959147,4.40712 3.576887,5.9318 0.825837,2.03829 1.69783,3.42182 2.824313,4.48113 1.887651,1.7751 4.473126,2.88717 7.716088,3.31891 2.158571,0.28737 6.145427,0.14565 8.846566,-0.31445 0.516111,-0.0879 0.952432,-0.14467 0.969601,-0.12611 0.01719,0.0187 0.04744,2.72643 0.06727,6.01748 l 0.03607,5.9837 -0.281699,0.57364 c -0.523082,1.0652 -1.284394,1.50688 -2.704268,1.56889 -0.941693,0.0411 -1.014771,0.0283 -2.162178,-0.38233 -2.301725,-0.82354 -4.228778,-1.64195 -6.517565,-2.768 -6.378377,-3.1381 -11.563357,-6.89661 -16.595276,-12.02971 -9.197306,-9.38222 -15.023762,-21.42275 -16.685106,-34.4802 -0.351941,-2.7661 -0.408681,-3.83916 -0.406784,-7.69334 0.0019,-4.18024 0.09705,-5.59172 0.602377,-8.95041 1.302781,-8.65901 4.434249,-16.83105 9.257793,-24.15963 2.370071,-3.60092 4.531003,-6.2351 7.781187,-9.48529 5.047291,-5.0473 9.967661,-8.56039 16.33572,-11.66355 6.490506,-3.16284 13.054733,-5.00775 20.627893,-5.79758 2.149675,-0.22421 8.818244,-0.25575 10.861179,-0.0513 7.671295,0.7674 14.26178,2.54582 20.514627,5.53581 6.69364,3.20077 11.74118,6.76667 16.95278,11.97653 5.04555,5.04387 8.5563,9.96144 11.6626,16.33589 3.08867,6.33832 4.94839,12.87124 5.75095,20.20233 0.30135,2.7526 0.32556,9.12181 0.0448,11.78957 -0.38747,3.68216 -0.86406,6.35096 -1.72399,9.65438 -4.7673,18.31325 -18.2283,33.61451 -35.803787,40.69852 -2.891465,1.16544 -4.067808,1.46219 -5.098621,1.28623 z"
id="path943"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
images/internet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -23,7 +23,7 @@ start=`date +%s`
&& echo "bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/kubo_v0.20.0_linux.install.sh)" \
&& architecture=$(uname -m) && [[ $architecture == "x86_64" || $architecture == "aarch64" || "$architecture" == "armv7l" ]] \
&& bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/kubo_v0.20.0_linux.install.sh) \
|| echo "=== Installez IPFS KUBO puis relancez Install ==="
|| echo "=== IPFS FOUND === OK"
[[ ! $(which ipfs) ]] && echo "INSTALL IPFS PLEASE" && exit 1
#################################################################### TEST
@ -32,8 +32,8 @@ start=`date +%s`
if [[ ! -d ~/.zen/game/players/ ]];
then
echo "#############################################"
echo "###### ASTROPORT.ONE IPFS STATION ##############"
echo "################ TW Ŋ1 PROTOCOL #############"
echo "###### ASTROPORT.ONE STATION ##############"
echo "############# TW HOSTING & Ŋ1 SERVICES #############"
echo "##################################################"
echo ; echo "UPDATING SYSTEM REPOSITORY"
@ -106,29 +106,6 @@ echo "#############################################"
sudo npm install -g tiddlywiki
[[ $? != 0 ]] && echo "INSTALL tiddlywikiFAILED." && echo "INSTALL tiddlywiki FAILED." >> /tmp/install.errors.log
#~ echo "#############################################"
#~ echo "######### PATIENCE #################"
#~ echo "#############################################
#~ ### PROPOSITION DE LOGICIELS COMPLEMETAIRES
#~ #############################################
#~ ## OpenCV = 'Vision par Ordinateur en Intelligence Amie'
#~ # sudo apt-get install python3-opencv -y
#~ ## CONVERT AUDIO TO MIDI
#~ # pip install basic-pitch
#~ ## CACHER LES VISAGES
#~ # python3 -m pip install 'git+https://github.com/ORB-HD/deface'
#~ ## ...
#~ ## DES SUGGESTIONS ?
#~ ## CONTACTER support@qo-op.com
#~ #################################################"
## MAILJET SSMTP RELAYING : ADD YOUR CREDENTIALS
#~ sudo cp ~/.zen/Astroport.ONE/templates/.ssmtprc /etc/ssmtp/ssmtp.conf
#~ sudo ln -s /usr/sbin/ssmtp /usr/bin/ssmtp
#~ sudo chmod 640 /etc/ssmtp/ssmtp.conf
#~ sudo chgrp mail /etc/ssmtp/ssmtp.conf
#~ echo "$USER:support@g1sms.fr:mail.asycn.io:587" | (sudo su -c 'tee -a /etc/ssmtp/revaliases')
## Correct PDF restrictions for imagemagick
echo "######### IMAGEMAGICK PDF ############"
if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then
@ -136,9 +113,9 @@ if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then
sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml
fi
echo "###########################"
echo "## ADDING CRYPTO LAYER ================"
echo "#####################################"
echo "## CRYPTO LIB & PYTHON TOOLS"
export PATH=$HOME/.local/bin:$PATH
for i in pip setuptools wheel cryptography Ed25519 base58 google duniterpy silkaj pynacl pgpy pynentry SecureBytes amzqr pdf2docx pyppeteer; do
echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
python -m pip install --break-system-packages -U $i
@ -151,7 +128,7 @@ echo "#############################################"
########### QRCODE : ZENCARD / G1BILLET : PRINTER ##############
if [[ $USER != 'xbian' ]]; then
echo "INSTALL PRINTER FOR G1BILLET ASTROID ZENCARD ..."
echo "INSTALL PRINTER FOR G1BILLET + AstroID & Zencard ..."
saisie="OK"
if [[ $saisie != "" ]]; then
## PRINT & FONTS
@ -166,7 +143,7 @@ if [[ $USER != 'xbian' ]]; then
echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/brother_ql_print" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/brother_ql_print')
## G1BILLET
echo "INSTALLING G1BILLET SERVICE : http://g1billet.localhost:33101"
echo "INSTALL G1BILLET SERVICE : http://g1billet.localhost:33101"
cd ~/.zen
git clone https://git.p2p.legal/qo-op/G1BILLET.git
cd G1BILLET && ./setup_systemd.sh
@ -176,6 +153,8 @@ if [[ $USER != 'xbian' ]]; then
fi
#####################
#### ~/.bashrc
echo "########################### ♥BOX"
sudo ln -f -s /usr/bin/python3 /usr/bin/python
@ -209,7 +188,6 @@ echo "/ip4/127.0.0.1/tcp/5001" > ~/.ipfs/api
echo "=== SETUP ASTROPORT"
~/.zen/Astroport.ONE/setup.sh
#~ if [[ $(which kodi) && $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]]; then
#~ echo "#############################################"
#~ echo " ### BONUS APP ## IPFS # KODI FR PLUGIN ## "
@ -224,46 +202,41 @@ echo "=== SETUP ASTROPORT"
#~ ) &
#~ fi
end=`date +%s`
echo Installation time was `expr $end - $start` seconds.
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "xXX ERRORS XXx"
echo "xXX LOG ERRORS XXx"
cat /tmp/install.errors.log
echo "xXX please report any errors encountered during install XXx"
echo "################XXXX#########################"
echo "RUN TEST : ~/.zen/Astroport.ONE/test.sh"
echo
echo "#############################################"
echo "Astroport.ONE - Web3 Information System over IPFS - "
end=`date +%s`
echo Execution time was `expr $end - $start` seconds.
echo "#############################################"
echo
echo "(DES) ACTIVATE with
~/.zen/Astroport.ONE/tools/cron_VRFY.sh ON (OFF)"
echo
echo "### FOR JOINING BOOSTRAP LIST #############################"
echo "### MAILJET CREDENTIALS
contact support@qo-op.com for initial UPlanet ~/.zen/MJ_APIKEY"
echo "##GROUND CONTROL #################################"
echo "* WEB : http://127.0.0.1:1234/"
echo "* CLI : ~/.zen/Astroport.ONE/command.sh"
echo "#############################################"
echo "### SUPPORT #############################"
echo "### support@qo-op.com"
echo "#############################################"
echo ">>> Welcome Space Kitty <<<"
echo "Explore Web2.0 / WEb3 frontier"
echo "Please. Continue keygen procedure..."
echo
echo "COMAND INTERFACE"
echo "CLI : ~/.zen/Astroport.ONE/command.sh"
echo "WEB : http://127.0.0.1:1234/"
##########################################################
## ON BOARDING PLAYER
# ~/.zen/Astroport.ONE/start.sh
espeak "Welcome Space Kitty" 2>/dev/null
echo ">>> Welcome Space Kitty <<<"
echo "Explore Web2.0 / WEb3 frontier"
echo "Join Dragons WOT by continuing keygen procedure..."
echo "#############################################"
# DESACTIVATING ASTROPORT DAEMONS
~/.zen/Astroport.ONE/tools/cron_VRFY.sh OFF
echo "############################## ♥BOX READY ###"
echo ">>> ACTIVATE ASTROPORT DAEMONS <<<
~/.zen/Astroport.ONE/tools/cron_VRFY.sh ON"
#~ [[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] \
#~ && xdg-open "http://astroport.localhost:1234" \
#~ || ~/.zen/Astroport.ONE/command.sh
xdg-open "http://127.0.0.1:1234/" 2>/dev/null
else
echo "Installation existante !!

View File

@ -1,44 +0,0 @@
#!/bin/bash
[ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
mkdir ~/.zen/tmp
cd ~/.zen/tmp
# Check processor architecture
architecture=$(uname -m)
# Download appropriate version of kubo
if [ "$architecture" == "x86_64" ]; then
wget -O kubo.tar.gz https://dist.ipfs.tech/kubo/v0.16.0/kubo_v0.16.0_linux-amd64.tar.gz
elif [ "$architecture" == "aarch64" ]; then
wget -O kubo.tar.gz https://dist.ipfs.tech/kubo/v0.16.0/kubo_v0.16.0_linux-arm64.tar.gz
elif [ "$architecture" == "armv7l" ]; then
wget -O kubo.tar.gz https://dist.ipfs.tech/kubo/v0.16.0/kubo_v0.16.0_linux-arm.tar.gz
else
echo "Error: Unknown architecture"
exit 1
fi
tar -xvzf kubo.tar.gz
cd kubo
# Install
sudo bash install.sh
# Test & clean
[[ $(ipfs --version) ]] \
&& rm -Rf ~/.zen/tmp/kubo*
[[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open https://www.openstreetmap.org
echo "OUVREZ https://www.openstreetmap.org"
echo "ET CALIBREZ LA SYNCHRO 20H12 AVEC LE TEMPS NATUREL"
echo "SAISIR LES COORD. GPS DE VOTRE STATION IPFS (ex: 48.87039, 2.31673)"
read GPS
[[ $GPS == "" ]] && GPS="48.87039, 2.31673"
mkdir -p ~/.zen/
echo "$GPS" > ~/.zen/GPS
exit 0

View File

@ -1,19 +1,42 @@
#!/bin/bash
## SHOW DHT STATS
echo "#########################"
echo "------------------------------------------------- ~/.zen/tmp/ipfs.stats.dht.wan"
echo "GETTING DHT STATS"
ipfs stats dht wan > ~/.zen/tmp/ipfs.stats.dht.wan
cat ~/.zen/tmp/ipfs.stats.dht.wan
# cat ~/.zen/tmp/ipfs.stats.dht.wan
echo "#########################"
## BOOSTRAP
echo "#########################"
echo "BOOSTRAP NODES"
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | grep -v '^[[:space:]]*$')
do
echo
ipfsnodeid=${bootnode##*/}
ipfs swarm peers | grep $bootnode
ipfs ping -n 3 $bootnode
[ $? = 0 ] && ipfs swarm connect $bootnode \
|| echo "BAD NODE $bootnode"
echo "*****"
do
ipfsnodeid=${bootnode##*/}
ipfs swarm peers | grep $bootnode
ipfs --timeout 15s ping -n 3 $bootnode
[ $? = 0 ] && ipfs swarm connect $bootnode \
|| echo "FAILED ipfs ping $bootnode"
echo "*****"
echo "in DHT ? --------------"
cat ~/.zen/tmp/ipfs.stats.dht.wan | grep $ipfsnodeid
echo "-------------------------------------------------"
cat ~/.zen/tmp/ipfs.stats.dht.wan | grep $ipfsnodeid
done
done
## SWARM
echo
echo "#########################"
echo "SWARM NODES"
ls ~/.zen/tmp/swarm
echo "-------------------------------------------------"
for ipfsnodeid in $(ls ~/.zen/tmp/swarm);
do
ipfs --timeout 15s ping -n 3 /p2p/$ipfsnodeid
[ $? = 0 ] && ipfs swarm connect /p2p/$ipfsnodeid \
|| echo "FAILED ipfs ping /p2p/$ipfsnodeid"
echo "in DHT ? --------------"
cat ~/.zen/tmp/ipfs.stats.dht.wan | grep $ipfsnodeid
echo "-------------------------------------------------"
done

4
search
View File

@ -11,11 +11,11 @@ if [ "$1" == "" ]; then
else
echo " Searching for "$1" recursively. Please Wait..."
echo "------------------------------------------------------------------------------"
grep -h -r --exclude-dir='.git*' --exclude='twuplanet.html' --exclude='twsector.html' -H --colour=always "$1" ./
grep -h -r --exclude-dir='.git*' --exclude='twsector.html' --exclude='twuplanet.html' --exclude='twdefault.html' -H --colour=always "$1" ./
fi
echo "------------------------------------------------------------------------------"
if [ "$2" != "" ]; then
echo " To replace \"$1\" whith \"$2\", please run"
echo " grep -rl --exclude-dir='.git*' --exclude='twuplanet.html' --exclude='twsector.html' '$1' ./ | xargs sed -i 's~$1~$2~g'"
echo " grep -rl --exclude-dir='.git*' --exclude='twsector.html' --exclude='twuplanet.html' --exclude='twdefault.html' '$1' ./ | xargs sed -i 's~$1~$2~g'"
fi
exit 0

View File

@ -159,11 +159,14 @@ iframe {
<div id="console">
| <a href="INFO.png" target="aframe" title="_SECTOR_ INFO"> _<img width=20 src="http://127.0.0.1:8080/ipfs/QmaeRPu6yYZ8iRACgkd4DtD1V1H8NdXT8yf5Gfxf17c9pm" ></a> |
<a href="https://transiscope.gogocarto.fr/map#/carte/@_LAT_,_LON_,12z?cat=all" target="aframe" title="- Transiscope - Le portail des alternatives"><img width=20 src="http://127.0.0.1:8080/ipfs/QmbM7PH7untyyZRYHTT1Y27rdaYNWUcBF1YAeXbFMW7GX8" ></a> |
<a href="/ipfs/QmXex8PTnQehx4dELrDYuZ2t5ag85crYCBxm3fcTjVWo2k/#/app/wot/tx/_SECTORG1PUB_/" target="aframe" title="SECTOR WALLET"><img width=20 src="http://127.0.0.1:8080/ipfs/QmQd7rNi13eHHWaEfqKLHxmY6V5HWakGsXNZH8QVoGQvNt" ></a> |
<a href="_CESIUMIPFS_/#/app/wot/tx/_SECTORG1PUB_/" target="aframe" title="SECTOR WALLET"><img width=20 src="http://127.0.0.1:8080/ipfs/QmQd7rNi13eHHWaEfqKLHxmY6V5HWakGsXNZH8QVoGQvNt" ></a> |
<a href="/ipfs/_ZONEIPFS_/TW" target="aframe" title="_ZONE_ TW NEWS"> _<img width=20 src="http://127.0.0.1:8080/ipfs/QmZX2Titv5L488iNVHwbRNeuZh2PJULSCfxoSgF4Qzv547" ></a> |
<a href="https://minetest.dustlabs.io/?launch" target="aframe" title="- Minetest - Building Blocks on UPlanet - DEV -"><img width=20 src="http://127.0.0.1:8080/ipfs/Qmeaaee1gojMHkos4Quqqw8dwmF4SDP8kTCgAdnJiTeVgJ" ></a> |
<a href="https://groceliande.com/" target="aframe" title="© Groceliande 2023"> ( <img width=20 src="http://127.0.0.1:8080/ipfs/QmTPYJqxmsZkNzjEQv1BZ4VWBwNvXLc8MdHwZEvhKrdaJQ" > ) </a>
<a href="http://127.0.0.1:8080/ipfs/QmcSkcJ2j7GAsC2XhVqGSNAKVRpXgxfjjvDbhD5YxrncZY/?room=_PHONEBOOTH_" target="aframe" title="_SECTOR_ VISIO 📺"> ( ° - °)📺<img width=20 src="http://127.0.0.1:8080/ipfs/QmU3JKMFDnRUWv1juLcA4YEPxHLcXrgrn9FdbXaPgZgwbT" ></a> |
<a href="_HACKGIPFS_" target="aframe" title="Ẑen Quest"> ( <img width=20 src="http://127.0.0.1:8080/ipfs/QmNSc5e4K2qzpWpiqHm47KNywxNjsnsN8R2ebpqEespyBX" > ) </a>
<!--
<a href="https://carte.monnaie-libre.fr" target="aframe" title="MONNAIE LIBRE"> ( <img width=20 src="http://127.0.0.1:8080/ipfs/QmP1DzFR57kQTpC8Fc8bEVtuEkpXTfkBcb4ryrhXRieMcq" > ) </a>
-->
<a href="_IPFSNINJA_/?room=_PHONEBOOTH_&record" target="aframe" title="_SECTOR_ VISIO 📺"> ( ° - °)📺<img width=20 src="http://127.0.0.1:8080/ipfs/QmU3JKMFDnRUWv1juLcA4YEPxHLcXrgrn9FdbXaPgZgwbT" ></a> |
&nbsp;&nbsp;&nbsp;<button id="fullscreenButton" onclick="toggleConsoleFullScreen()"> ^^ </button>&nbsp;&nbsp;&nbsp;<button onclick="hideConsole()"> X </button>
<iframe name="aframe" id="aframe" src="INFO.png" width="100%" height="100%"></iframe>
</div>

Some files were not shown because too many files have changed in this diff Show More