Merge branch 'papiche:master' into master
2
12345.sh
@ -133,7 +133,7 @@ while true; do
|
|||||||
( nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo " (‿/‿) $PORT CONSUMED in "`expr $(date +%s) - $start`" seconds." ) &
|
( nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo " (‿/‿) $PORT CONSUMED in "`expr $(date +%s) - $start`" seconds." ) &
|
||||||
else
|
else
|
||||||
mySalt | \
|
mySalt | \
|
||||||
sed "s~http://127.0.0.1:12345~${myASTROPORT}:${PORT}~g" | \
|
sed "s~http://127.0.0.1:12345~http://${myASTROPORT}:${PORT}~g" | \
|
||||||
sed "s~https://qo-op.com~${myUPLANET}~g" | \
|
sed "s~https://qo-op.com~${myUPLANET}~g" | \
|
||||||
( nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo " (‿/‿) $PORT CONSUMED in "`expr $(date +%s) - $start`" seconds." ) &
|
( nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo " (‿/‿) $PORT CONSUMED in "`expr $(date +%s) - $start`" seconds." ) &
|
||||||
fi
|
fi
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
########################################################################
|
########################################################################
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"${MY_PATH}\" && pwd )`" # absolutized and normalized
|
||||||
. "$MY_PATH/tools/my.sh"
|
. "${MY_PATH}/tools/my.sh"
|
||||||
start=`date +%s`
|
start=`date +%s`
|
||||||
echo "20H12 (♥‿‿♥) $(hostname -f) $(date)"
|
echo "20H12 (♥‿‿♥) $(hostname -f) $(date)"
|
||||||
espeak "Ding" > /dev/null 2>&1
|
espeak "Ding" > /dev/null 2>&1
|
||||||
@ -15,18 +15,26 @@ LOWMODE=$(sudo systemctl status ipfs | grep disabled) ## IPFS DISABLED - START O
|
|||||||
[[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]] && LOWMODE="NO 5001" ## IPFS IS STOPPED
|
[[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]] && LOWMODE="NO 5001" ## IPFS IS STOPPED
|
||||||
[[ ! $isLAN ]] && LOWMODE="" ## LOWMODE ONLY FOR LAN STATION
|
[[ ! $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')
|
# echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
|
||||||
|
|
||||||
sudo systemctl restart ipfs && sleep 10
|
sudo systemctl restart ipfs && sleep 10
|
||||||
|
|
||||||
floop=0
|
floop=0
|
||||||
while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do
|
while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do
|
||||||
sleep 10
|
sleep 10
|
||||||
((floop++)) && [ $floop -gt 36 ] \
|
((floop++)) && [ $floop -gt 36 ] \
|
||||||
&& echo "ERROR. IPFS daemon not restarting" \
|
&& echo "ERROR. IPFS daemon not restarting" \
|
||||||
&& $MY_PATH/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "IPFS RESTART ERROR 20H12" \
|
&& ${MY_PATH}/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "IPFS RESTART ERROR 20H12" \
|
||||||
&& exit 1
|
&& exit 1
|
||||||
done
|
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
|
||||||
|
echo "TODAY UPlanet landings"
|
||||||
|
ls ~/.zen/tmp/ZONE_* 2>/dev/null
|
||||||
|
|
||||||
|
## REMOVE TMP BUT KEEP SWARM and coucou
|
||||||
mv ~/.zen/tmp/swarm ~/.zen/swarm
|
mv ~/.zen/tmp/swarm ~/.zen/swarm
|
||||||
mv ~/.zen/tmp/coucou ~/.zen/coucou
|
mv ~/.zen/tmp/coucou ~/.zen/coucou
|
||||||
rm -Rf ~/.zen/tmp/*
|
rm -Rf ~/.zen/tmp/*
|
||||||
@ -39,36 +47,42 @@ mv ~/.zen/coucou ~/.zen/tmp/coucou
|
|||||||
&& rm -Rf ~/.zen/G1BILLET/tmp/*
|
&& rm -Rf ~/.zen/G1BILLET/tmp/*
|
||||||
|
|
||||||
## UPDATE Astroport.ONE code
|
## UPDATE Astroport.ONE code
|
||||||
cd ~/.zen/Astroport.ONE/
|
cd ${MY_PATH}/
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
## SOON /ipns/ Address !!!
|
## SOON /ipns/ Address !!!
|
||||||
|
|
||||||
# espeak "20 HOURS 12 MINUTES. ASTROBOT RUNNING." > /dev/null 2>&1
|
# espeak "20 HOURS 12 MINUTES. ASTROBOT RUNNING." > /dev/null 2>&1
|
||||||
## Updating yt-dlp
|
## Updating yt-dlp
|
||||||
$MY_PATH/youtube-dl.sh
|
${MY_PATH}/youtube-dl.sh
|
||||||
sudo youtube-dl -U
|
sudo youtube-dl -U
|
||||||
|
|
||||||
# Refresh ~/.zen/game/world/G1VOEU
|
## PING BOOSTRAP & SWARM NODES
|
||||||
# NOW RUN FROM PLAYER.refresh.sh !! ~/.zen/Astroport.ONE/RUNTIME/VOEUX.refresh.sh
|
${MY_PATH}/ping_bootstrap.sh
|
||||||
|
|
||||||
|
#####################################
|
||||||
# espeak "Players refresh" > /dev/null 2>&1
|
# espeak "Players refresh" > /dev/null 2>&1
|
||||||
# Refresh ~/.zen/game/players/PLAYER
|
# 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
|
# 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
|
# espeak "REFRESHING NODE" > /dev/null 2>&1
|
||||||
~/.zen/Astroport.ONE/RUNTIME/NODE.refresh.sh
|
#####################################
|
||||||
|
${MY_PATH}/RUNTIME/NODE.refresh.sh
|
||||||
|
#####################################
|
||||||
|
|
||||||
## if [[ ! $isLAN ]]; then
|
## if [[ ! $isLAN ]]; then
|
||||||
## REFRESH BOOSTRAP LIST (OFFICIAL SWARM)
|
## REFRESH BOOSTRAP LIST (OFFICIAL SWARM)
|
||||||
espeak "bootstrap refresh" > /dev/null 2>&1
|
espeak "bootstrap refresh" > /dev/null 2>&1
|
||||||
|
|
||||||
ipfs bootstrap rm --all > /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
|
do
|
||||||
ipfsnodeid=${bootnode##*/}
|
ipfsnodeid=${bootnode##*/}
|
||||||
ipfs bootstrap add $bootnode
|
ipfs bootstrap add $bootnode
|
||||||
@ -85,11 +99,13 @@ seconds=$((dur % 60))
|
|||||||
echo "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds"
|
echo "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds"
|
||||||
echo "20H12 (♥‿‿♥) Execution time was $dur seconds."
|
echo "20H12 (♥‿‿♥) Execution time was $dur seconds."
|
||||||
|
|
||||||
# ~/.zen/Astroport.ONE/tools/ipfs_P2P_forward.sh ## COULD FORWARD LOCAL TCP PORT TO SWARM
|
## DRAGON SSH WOT
|
||||||
rm ~/.zen/game/players/localhost/latest
|
echo "STOP DRAGONS WOT"
|
||||||
|
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh off
|
||||||
|
## RESTART
|
||||||
|
|
||||||
## MAIL LOG : support@qo-op.com ##
|
## MAIL LOG : support@qo-op.com ##
|
||||||
$MY_PATH/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "20H12"
|
${MY_PATH}/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "20H12"
|
||||||
|
|
||||||
espeak "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds" > /dev/null 2>&1
|
espeak "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds" > /dev/null 2>&1
|
||||||
|
|
||||||
@ -99,9 +115,9 @@ espeak "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds" > /dev/nu
|
|||||||
## KILL ALL REMAINING nc
|
## KILL ALL REMAINING nc
|
||||||
killall nc 12345.sh > /dev/null 2>&1
|
killall nc 12345.sh > /dev/null 2>&1
|
||||||
|
|
||||||
## OPEN API ENGINE
|
## SYSTEMD OR NOT SYSTEMD
|
||||||
if [[ ! -f /etc/systemd/system/astroport.service ]]; then
|
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=$!
|
PID=$!
|
||||||
echo $PID > ~/.zen/.pid
|
echo $PID > ~/.zen/.pid
|
||||||
else
|
else
|
||||||
@ -111,16 +127,23 @@ else
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "IPFS LOW MODE ?"
|
echo "IPFS DAEMON LEVEL"
|
||||||
|
######### IPFS DAMEON NOT RUNNING ALL DAY
|
||||||
## IF IPFS DAEMON DISABLED : WAIT 1H & STOP IT
|
## IF IPFS DAEMON DISABLED : WAIT 1H & STOP IT
|
||||||
[[ $LOWMODE != "" ]] \
|
[[ $LOWMODE != "" ]] \
|
||||||
&& echo "ON. $LOWMODE" \
|
&& echo "STOP IPFS $LOWMODE" \
|
||||||
&& sleep 360 \
|
&& sleep 3600 \
|
||||||
&& sudo systemctl stop ipfs \
|
&& sudo systemctl stop ipfs \
|
||||||
&& exit 0
|
&& exit 0
|
||||||
|
|
||||||
echo "OFF. RESTART IPFS"
|
echo "HIGH. RESTART IPFS"
|
||||||
sleep 60
|
sleep 60
|
||||||
sudo systemctl restart ipfs
|
sudo systemctl restart ipfs
|
||||||
|
|
||||||
|
#################################
|
||||||
|
### DRAGON WOT : SSH P2P RING OPENING
|
||||||
|
#################################
|
||||||
|
sleep 30
|
||||||
|
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -87,31 +87,36 @@ fi
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
if [[ ${QRCODE} == "station" ]]; then
|
if [[ ${QRCODE} == "station" ]]; then
|
||||||
|
|
||||||
#~ # Keep 2nd try of the day
|
## CHECK FOR ANY ALREADY RUNNING make_image_ipfs_index_carousel
|
||||||
#~ [[ ! -s ~/.zen/tmp/_ISTATION ]] \
|
carouselrunning=$(ps axf --sort=+utime | grep -w 'make_image_ipfs_index_carousel' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||||
#~ && mv ~/.zen/tmp/ISTATION ~/.zen/tmp/_ISTATION \
|
|
||||||
#~ || cp ~/.zen/tmp/_ISTATION ~/.zen/tmp/ISTATION
|
|
||||||
|
|
||||||
if [[ ! -s ~/.zen/tmp/ISTATION ]]; then
|
if [[ ! -s ~/.zen/tmp/ISTATION ]]; then
|
||||||
|
if [[ $carouselrunning ]]; then
|
||||||
|
ISTATION="/ipfs/QmVTHH8sTXEqRBsvcKo5jDo16rvp7Q7ERyHZP5vmWUxeS6" ## G1WorldCrafting.jpg
|
||||||
|
else
|
||||||
## GENERATE PLAYER G1 TO ZEN ACCOUNTING
|
## GENERATE PLAYER G1 TO ZEN ACCOUNTING
|
||||||
ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1)
|
ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1)
|
||||||
echo $ISTATION > ~/.zen/tmp/ISTATION ## STATION G1WALLET CAROUSEL
|
echo $ISTATION > ~/.zen/tmp/ISTATION ## STATION G1WALLET CAROUSEL
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
ISTATION=$(cat ~/.zen/tmp/ISTATION)
|
ISTATION=$(cat ~/.zen/tmp/ISTATION)
|
||||||
fi
|
fi
|
||||||
## SHOW G1PALPAY FRONT (IFRAME)
|
|
||||||
sed "s~_STATION_~${myIPFSW}${ISTATION}/~g" $MY_PATH/../templates/ZenStation/index.html > ~/.zen/tmp/${MOATS}/index.htm
|
## SHOW ZenStation FRONT
|
||||||
|
sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../templates/ZenStation/index.html > ~/.zen/tmp/${MOATS}/index.htm
|
||||||
[[ ! $isLAN ]] && sed -i "s~MENU~HOSTING~g" ~/.zen/tmp/${MOATS}/index.htm
|
[[ ! $isLAN ]] && sed -i "s~MENU~HOSTING~g" ~/.zen/tmp/${MOATS}/index.htm
|
||||||
sed -i "s~http://127.0.0.1:8080~${myIPFSW}~g" ~/.zen/tmp/${MOATS}/index.htm
|
sed -i "s~http://127.0.0.1:8080~${myIPFS}~g" ~/.zen/tmp/${MOATS}/index.htm
|
||||||
sed -i "s~http://127.0.0.1:33101~${myG1BILLET}~g" ~/.zen/tmp/${MOATS}/index.htm
|
sed -i "s~http://127.0.0.1:33101~${myG1BILLET}~g" ~/.zen/tmp/${MOATS}/index.htm
|
||||||
sed -i "s~http://astroport.localhost:1234~${myASTROPORT}~g" ~/.zen/tmp/${MOATS}/index.htm
|
sed -i "s~http://astroport.localhost:1234~${myASTROPORT}~g" ~/.zen/tmp/${MOATS}/index.htm
|
||||||
|
|
||||||
WSTATION="/ipfs/$(ipfs add -q ~/.zen/tmp/${MOATS}/index.htm)"
|
WSTATION="/ipfs/$(ipfs add -q ~/.zen/tmp/${MOATS}/index.htm)"
|
||||||
echo $WSTATION > ~/.zen/tmp/WSTATION
|
echo $WSTATION > ~/.zen/tmp/WSTATION
|
||||||
|
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
echo "NEW WSTATION ${myIPFSW}${WSTATION} Execution time was "`expr $end - $start` seconds.
|
echo "NEW WSTATION ${myIPFS}${WSTATION} Execution time was "`expr $end - $start` seconds.
|
||||||
## SEND TO WSTATION PAGE
|
|
||||||
sed "s~_TWLINK_~${myIPFSW}${WSTATION}/~g" ${MY_PATH}/../templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
|
##302 REDIRECT TO WSTATION IPFS
|
||||||
|
sed "s~_TWLINK_~${myIPFS}${WSTATION}/~g" ${MY_PATH}/../templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
|
||||||
sed -i "s~Set-Cookie*~Set-Cookie: $COOKIE~" ~/.zen/tmp/${MOATS}/index.redirect
|
sed -i "s~Set-Cookie*~Set-Cookie: $COOKIE~" ~/.zen/tmp/${MOATS}/index.redirect
|
||||||
echo "url='"${myIPFSW}${WSTATION}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
|
echo "url='"${myIPFSW}${WSTATION}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
|
||||||
(
|
(
|
||||||
|
11
API/SALT.sh
@ -168,17 +168,16 @@ mkdir -p ~/.zen/tmp/${MOATS}/
|
|||||||
#~ echo "VISA.new : \"$SALT\" \"$PEPPER\" \"${EMAIL}\" \"$PSEUDO\" \"${WHAT}\"" > ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
|
#~ echo "VISA.new : \"$SALT\" \"$PEPPER\" \"${EMAIL}\" \"$PSEUDO\" \"${WHAT}\"" > ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
|
||||||
${MY_PATH}/../RUNTIME/VISA.new.sh "$SALT" "$PEPPER" "${EMAIL}" "$PSEUDO" "${WHAT}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
|
${MY_PATH}/../RUNTIME/VISA.new.sh "$SALT" "$PEPPER" "${EMAIL}" "$PSEUDO" "${WHAT}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
|
||||||
|
|
||||||
${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt "LOG ZenCard creation" ## Send VISA.new log to EMAIL
|
#~ ${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt "LOG ZenCard creation" ## Send VISA.new log to EMAIL
|
||||||
|
|
||||||
echo "Le code de votre ASTROID est ${PASS}, scannez-le sur La♥Box ẐenStation (demo : https://astroport.copylaradio.com)" > ~/.zen/tmp/${MOATS}/intro.txt
|
echo "ASTROID PIN=${PASS}, operate on all La♥Box Web3 ẐenStation (WWW : https://astroport.copylaradio.com)"
|
||||||
|
## :: TRICK :: EXECUTE LAST VISA.new.sh output LINE : export above VARs
|
||||||
## EXECUTE LAST LINE
|
|
||||||
$(cat ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt | tail -n 1)
|
$(cat ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt | tail -n 1)
|
||||||
echo "export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$PLAYER ASTROFEED=$FEEDNS PASS=$PASS"
|
echo "export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$PLAYER ASTROFEED=$FEEDNS PASS=$PASS"
|
||||||
|
|
||||||
BILLETNAME=$(echo "$SALT" | sed 's/ /_/g')
|
BILLETNAME=$(echo "$SALT" | sed 's/ /_/g')
|
||||||
mpack -a -s "La♥Box : ASTROID :+: TW :+: " -d ~/.zen/tmp/${MOATS}/intro.txt \
|
#~ mpack -a -s "La♥Box : ASTROID :+: TW :+: " -d ~/.zen/tmp/${MOATS}/intro.txt \
|
||||||
~/.zen/G1BILLET/tmp/g1billet/${PASS}/${BILLETNAME}.BILLET.jpg ${PLAYER}
|
#~ ~/.zen/G1BILLET/tmp/g1billet/${PASS}/${BILLETNAME}.BILLET.jpg ${PLAYER}
|
||||||
|
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
dur=`expr $end - $startvisa`
|
dur=`expr $end - $startvisa`
|
||||||
|
@ -167,15 +167,14 @@ echo "UMAPNS : ${myIPFS}/ipns/${UMAPNS}"
|
|||||||
|
|
||||||
## ALL TEST PASSED -> CREATE ZENCARD + ASTROID
|
## ALL TEST PASSED -> CREATE ZENCARD + ASTROID
|
||||||
NPASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-9) ## NOUVEAU PASS 8 CHIFFRES
|
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"
|
PPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 4) ## STRONGER TW SECURITY "AlpH4nUm"
|
||||||
DPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 2) ## STRONGER TW SECURITY "AlpH4nUm"
|
|
||||||
NPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 10) ## 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
|
## 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
|
## 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
|
${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
|
## 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
|
## HTTP nc ON PORT RESPONSE
|
||||||
echo "$HTTPCORS
|
echo "$HTTPCORS
|
||||||
@ -219,7 +218,7 @@ echo "$HTTPCORS
|
|||||||
<h1>UPlanet Registration</h1>
|
<h1>UPlanet Registration</h1>
|
||||||
Your AstroID seeds are:<br>
|
Your AstroID seeds are:<br>
|
||||||
<br>
|
<br>
|
||||||
<h2>${EMAIL}_${PPASS}_${DPASS}</h2>
|
<h2>${EMAIL}_${PPASS}</h2>
|
||||||
<h1>${NPASS}</h1>
|
<h1>${NPASS}</h1>
|
||||||
|
|
||||||
Generating account...
|
Generating account...
|
||||||
|
110
API/ZONE.sh
@ -7,8 +7,7 @@
|
|||||||
## API: ZONE
|
## API: ZONE
|
||||||
## Used by OSM2IPFS map_render.html & other UPlanet Client App
|
## Used by OSM2IPFS map_render.html & other UPlanet Client App
|
||||||
# ?zone=DEG&ulat=LAT&ulon=LON
|
# ?zone=DEG&ulat=LAT&ulon=LON
|
||||||
## Search for TW numbers in received zone
|
## Search for TW numbers in received zone # >> return json
|
||||||
# = json
|
|
||||||
################################################################################
|
################################################################################
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
@ -42,48 +41,64 @@ function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
|||||||
|
|
||||||
## RUNNING UPLANET LAT/LON TW DETECTION
|
## RUNNING UPLANET LAT/LON TW DETECTION
|
||||||
mkdir -p ~/.zen/tmp/${MOATS}/
|
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)
|
# PREPARE HTTP RESPONSE (application/json)
|
||||||
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
|
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
|
||||||
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http
|
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http
|
||||||
|
|
||||||
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
|
LAT="${THIS}"
|
||||||
if [[ $DEG == "0.1" || $DEG == "1" ]]; then
|
[[ -z $LAT ]] && LAT=0.00
|
||||||
LAT=$(echo ${LAT} | cut -d '.' -f 1)
|
|
||||||
LON=$(echo ${LON} | cut -d '.' -f 1)
|
LON="${WHAT}"
|
||||||
ZONE="_${LAT}_${LON}"
|
[[ -z $LON ]] && LON=0.00
|
||||||
echo "ZONE = ${ZONE}"
|
|
||||||
ZONEG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${ZONE}" "${UPLANETNAME}${ZONE}")
|
LAT=$(makecoord ${LAT})
|
||||||
ZONETW="/ipns/"$(${MY_PATH}/../tools/keygen -t ipfs "${YESTERDATE}${UPLANETNAME}${ZONE}" "${YESTERDATE}${UPLANETNAME}${ZONE}")
|
LON=$(makecoord ${LON})
|
||||||
|
JSON="ZONE_${LAT}_${LON}_${DEG}.json"
|
||||||
|
|
||||||
|
[[ $(date +"%H%M") -gt 2012 ]] \
|
||||||
|
&& THEDATE=${TODATE} \
|
||||||
|
|| THEDATE=${YESTERDATE}
|
||||||
|
echo "${THEDATE}"
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
## SECTOR LEVEL
|
## SECTOR LEVEL
|
||||||
if [[ $DEG == "0.01" ]]; then
|
if [[ ${DEG} == "0.01" ]]; then
|
||||||
SECLAT="${LAT::-1}"
|
SECLAT="${LAT::-1}"
|
||||||
SECLON="${LON::-1}"
|
SECLON="${LON::-1}"
|
||||||
SECTOR="_${SECLAT}_${SECLON}"
|
SECTOR="_${SECLAT}_${SECLON}"
|
||||||
echo "SECTOR = ${SECTOR}"
|
echo "SECTOR = ${SECTOR}"
|
||||||
ZONEG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${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}")
|
ZONEINDEX="/ipns/"$(${MY_PATH}/../tools/keygen -t ipfs "${THEDATE}${UPLANETNAME}${SECTOR}" "${THEDATE}${UPLANETNAME}${SECTOR}")"/_index.html"
|
||||||
|
JSON="ZONE${SECTOR}_${DEG}.json"
|
||||||
|
|
||||||
fi
|
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
|
## UMAP LEVEL
|
||||||
if [[ $DEG == "0.001" ]]; then
|
if [[ ${DEG} == "0.001" ]]; then
|
||||||
|
|
||||||
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/TW/* 2>/dev/null | wc -l )
|
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 )
|
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/TW/* 2>/dev/null | wc -l )
|
||||||
@ -91,29 +106,36 @@ if [[ $DEG == "0.001" ]]; then
|
|||||||
echo " ## UMAP _${LAT}*_${LON}* = ${totnum} PLAYERs"
|
echo " ## UMAP _${LAT}*_${LON}* = ${totnum} PLAYERs"
|
||||||
|
|
||||||
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
|
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
|
||||||
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${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
|
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)
|
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
|
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 &
|
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
|
||||||
|
|
||||||
rm -Rf ~/.zen/tmp/${MOATS}/
|
rm -Rf ~/.zen/tmp/${MOATS}/
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
echo "(UMAP)_${LAT}_${LON} ${YESTERDATE} $UMAPNS Operation time was "`expr $end - $start` seconds.
|
echo "(UMAP)_${LAT}_${LON} ${THEDATE} $UMAPNS Operation time was "`expr $end - $start` seconds.
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## ALL OTHER DEG : SEARCH FOR UPLANET TW NUMBERS
|
##############################################
|
||||||
echo '{ "gridNumbers": [' >> ~/.zen/tmp/${MOATS}.http
|
## SEARCH FOR UPLANET TW NUMBERS IN THAT ZONE
|
||||||
|
echo '{ "gridNumbers": [' >> ~/.zen/tmp/${MOATS}.http.grid
|
||||||
|
|
||||||
for i in $(seq 0 9);
|
for i in $(seq 0 9);
|
||||||
do
|
do
|
||||||
ZLAT=$(echo "$LAT + $DEG * $i" | bc -l )
|
ZLAT=$(echo "$LAT + ${DEG} * $i" | bc -l )
|
||||||
[[ -z ${ZLAT} ]] && ZLAT=0
|
[[ -z ${ZLAT} ]] && ZLAT=0
|
||||||
# [[ ! $(echo $ZLAT | grep "\." ) ]] && ZLAT="${ZLAT}."
|
# [[ ! $(echo $ZLAT | grep "\." ) ]] && ZLAT="${ZLAT}."
|
||||||
for j in $(seq 0 9); do
|
for j in $(seq 0 9); do
|
||||||
ZLON=$(echo "$LON + $DEG * $j" | bc -l )
|
ZLON=$(echo "$LON + ${DEG} * $j" | bc -l )
|
||||||
[[ -z ${ZLON} ]] && ZLON=0
|
[[ -z ${ZLON} ]] && ZLON=0
|
||||||
# [[ ! $(echo $ZLON | grep "\." ) ]] && ZLON="${ZLON}."
|
# [[ ! $(echo $ZLON | grep "\." ) ]] && ZLON="${ZLON}."
|
||||||
echo " ## SEARCH UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*"
|
echo " ## SEARCH UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*"
|
||||||
@ -123,22 +145,30 @@ do
|
|||||||
|
|
||||||
[[ $totnum -gt 9 ]] && displaynum="X" || displaynum=$totnum
|
[[ $totnum -gt 9 ]] && displaynum="X" || displaynum=$totnum
|
||||||
|
|
||||||
[[ $displaynum != "0" ]] && echo '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${displaynum}'", "ipns": "'${ZONETW}'" }
|
[[ $displaynum != "0" ]] && echo '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${displaynum}'", "ipns": "'${ZONEINDEX}'" }
|
||||||
,' >> ~/.zen/tmp/${MOATS}.http && echo "$DEG :" '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${totnum}'", "ipns": "'${ZONETW}'" }'
|
,' >> ~/.zen/tmp/${MOATS}.http.grid \
|
||||||
|
&& echo "${DEG} :" '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${totnum}'", "ipns": "'${ZONEINDEX}'" }'
|
||||||
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
sed -i '$ d' ~/.zen/tmp/${MOATS}.http ## REMOVE LAST ','
|
sed -i '$ d' ~/.zen/tmp/${MOATS}.http.grid ## REMOVE LAST ','
|
||||||
|
echo ']}' >> ~/.zen/tmp/${MOATS}.http.grid
|
||||||
|
|
||||||
echo ']}' >> ~/.zen/tmp/${MOATS}.http
|
echo "## ADD TO CACHE ~/.zen/tmp/${JSON}"
|
||||||
|
cp ~/.zen/tmp/${MOATS}.http.grid ~/.zen/tmp/${JSON}
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
### SEND RESPONSE ON PORT
|
### 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
|
## CLEANING
|
||||||
rm -Rf ~/.zen/tmp/${MOATS}/
|
rm -Rf ~/.zen/tmp/${MOATS}/
|
||||||
|
|
||||||
## TIMING
|
## TIMING
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
echo "(ZONE) Operation time was "`expr $end - $start` seconds.
|
echo "(ZONE) Operation time was "`expr $end - $start` seconds.
|
||||||
|
@ -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
|
|
@ -1,4 +1,4 @@
|
|||||||
# CONTAINS Address of 1st Bootstrap Stations (24/24 Public IP) - DO NOT EDIT MANUALY -
|
# UPlanet Swarm Bootstrap Stations # Adapt for your domain #
|
||||||
# https://ipfs.copylaradio.com ipfs.copylaradio.com
|
# https://ipfs.copylaradio.com ipfs.copylaradio.com
|
||||||
#################################################################
|
#################################################################
|
||||||
# astroport.libra.copylaradio.com
|
# astroport.libra.copylaradio.com
|
||||||
@ -7,9 +7,6 @@
|
|||||||
# scorpio.copylaradio.com
|
# scorpio.copylaradio.com
|
||||||
/dnsaddr/scorpio.copylaradio.com/p2p/12D3KooWS8EiLNay8qVnFaULpxW1X9sGZZz4wV8E6E3QEwCRktry
|
/dnsaddr/scorpio.copylaradio.com/p2p/12D3KooWS8EiLNay8qVnFaULpxW1X9sGZZz4wV8E6E3QEwCRktry
|
||||||
|
|
||||||
# astroport.sonic.copylaradio.com
|
|
||||||
# /ip4/161.97.174.60/tcp/4001/p2p/12D3KooWJnzYzJBtruXZwUQJriF1ePtDQCUQp4aNBV5FjpYVdfhc
|
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
###### WISHING TO ADD YOUR NODE TO OFFICIAL ASTROPORT BOOSTRAP LIST ?
|
###### WISHING TO ADD YOUR NODE TO OFFICIAL ASTROPORT BOOSTRAP LIST ?
|
||||||
###### ===> CONTACT support@qo-op.com
|
###### ===> CONTACT support@qo-op.com
|
||||||
|
6
A_boostrap_ssh.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
## SSH PUBLIC KEYS
|
||||||
|
## SEEDS OF THE DRAGONS WOT
|
||||||
|
## https://pad.p2p.legal/keygen
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEtg3SlRxtzsQnsBSeU83W0tvUyBTUvOU5lhjlbZVPCZ support@qo-op.com
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILTzTegcBD3WwIyTwT3kIh6jGqyLZzEzXhcuF6IhAjlc
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJBG6lim4ZmSmpU+GbOKJXO9arfRCP5TdKlhGa4CLJp
|
77
README.md
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
[Astroport DEV Journal](https://pad.p2p.legal/s/AstroportDEVJournal#)
|
[Astroport DEV Journal](https://pad.p2p.legal/s/AstroportDEVJournal#)
|
||||||
|
|
||||||
**Embark on a Cosmic Journey with ZenCard Payment System and Astroport.ONE**
|
**Embark on a Cosmic Journey with AstroID & ZenCard System and Astroport.ONE**
|
||||||
|
|
||||||
Are you weary of the constraints of traditional payment systems and concerned about the reliability
|
Are you weary of the constraints of traditional payment systems and concerned about the reliability
|
||||||
of your distributed storage solutions? Look no further! Our revolutionary ZenCard Payment System
|
of your distributed storage solutions? Look no further! Our revolutionary ZenCard QRCode based Payment System
|
||||||
and Astroport.ONE v1.0 seamlessly blend cutting-edge blockchain technology with interplanetary storage,
|
and Astroport.ONE v1.0 seamlessly blend cutting-edge blockchain technology with interplanetary storage,
|
||||||
offering you a commission-free and secure solution.
|
offering you a commission-free and secure solution.
|
||||||
|
|
||||||
@ -19,19 +19,6 @@ the planet is sliced into 0.01° segments, ensuring locally registered Tiddlers
|
|||||||
As a network engineer and system administrator committed to the Common Good, join us in constructing
|
As a network engineer and system administrator committed to the Common Good, join us in constructing
|
||||||
Astroport.ONE and shaping the future of secure and reliable distributed storage.
|
Astroport.ONE and shaping the future of secure and reliable distributed storage.
|
||||||
|
|
||||||
**ZenCard Payment System: Empowering Transactions, Empowering Dreams**
|
|
||||||
|
|
||||||
As blockchain makers, our ZenCard Payment System is not merely a crypto wallet; it's a game-changing payment card and terminal solution.
|
|
||||||
Our controlled coin-emitting blockchain transfers 1 coin to your ZenCard per fiat money unit saved in the fiscal host.
|
|
||||||
This unique approach makes blockchain accessible to everyone.
|
|
||||||
|
|
||||||
Become a donor and a shareholder, receiving Coins equivalent to the Euros paid. Achieve a stable coin state of "1=1" through seamless transactions
|
|
||||||
with a Host capable of sending and receiving Euros to users with zero fees, facilitated by PayPal integration.
|
|
||||||
|
|
||||||
Activate your account on UPlanet, make donations to https://opencollective.com/made-in-zen, and receive encrypted wallets via email—printed
|
|
||||||
in QRCode format for added security. Step into a future where financial transactions are commission-free,
|
|
||||||
and data is securely stored across the cosmos.
|
|
||||||
|
|
||||||
**Station Extra-Terrestre Astroport.ONE: Where Innovation Meets Tranquility**
|
**Station Extra-Terrestre Astroport.ONE: Where Innovation Meets Tranquility**
|
||||||
|
|
||||||
In the midst of this technological revolution, discover the Station Extra-Terrestre Astroport.ONE.
|
In the midst of this technological revolution, discover the Station Extra-Terrestre Astroport.ONE.
|
||||||
@ -73,43 +60,21 @@ At this point, if it exists "ASTROBOT/G1Tag.sh" program will publish the data re
|
|||||||
|
|
||||||
# INSTALLATION (Linux Mint / Ubuntu / DEBIAN)
|
# 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** ...
|
Tested on "Linux Mint" (Debian like distro compatible), the **hacker way for using & buidling new blockchain services** ...
|
||||||
|
|
||||||
```
|
INSTALL COMMAND
|
||||||
# install on system wide
|
|
||||||
# SOURCE GIT.P2P.LEGAL
|
|
||||||
bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/install.sh)
|
|
||||||
|
|
||||||
# SOURCE GITHUB
|
```
|
||||||
bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/install.sh)
|
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...
|
If all has gone well, you should find these processes running...
|
||||||
|
|
||||||
@ -126,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
|
After installation, you should have 3 new shortcuts on your desktop
|
||||||
|
|
||||||
@ -134,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.
|
* 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
|
* 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"!
|
## How to manage your "Astroport"!
|
||||||
|
|
||||||
You need to create a "PLAYER".
|
You need to create a "PLAYER".
|
||||||
@ -144,8 +118,9 @@ It is defined by email, salt, pepper, lat, lon and PASS
|
|||||||
```
|
```
|
||||||
Browse available functions
|
Browse available functions
|
||||||
|
|
||||||
A Station can host multiple "PLAYER and its TiddlyWiki".
|
A Station can host multiple "PLAYERs and TiddlyWikis".
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# "BASH API" : "♥BOX"
|
# "BASH API" : "♥BOX"
|
||||||
## http://astroport.localhost:1234
|
## http://astroport.localhost:1234
|
||||||
@ -366,19 +341,19 @@ GET /?player=${PLAYER}&moa=json&tag=G1CopierYoutube
|
|||||||
check available "logo.png" in [./images](./images)
|
check available "logo.png" in [./images](./images)
|
||||||
|
|
||||||
## ➤ UPLANET : Create Umap, AstroID & ZenCard for PLAYER (email)
|
## ➤ UPLANET : Create Umap, AstroID & ZenCard for PLAYER (email)
|
||||||
### ```/?uplanet=${PLAYER}&salt=${LAT}&pepper=${LON}&g1pub=${PASS}```
|
### ```/?uplanet=${PLAYER}&zlat=${LAT}&zlon=${LON}&g1pub=${PASS}```
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| :-------- | :------- | :-------------------------------- |
|
| :-------- | :------- | :-------------------------------- |
|
||||||
| `uplanet` | `email` | **Required** Your EMAIL token |
|
| `uplanet` | `email` | **Required** Your EMAIL token |
|
||||||
| `salt` | `decimal` | **Required** LATITUDE with 2 decimals digits |
|
| `zlat` | `decimal` | **Required** LATITUDE with 2 decimals digits |
|
||||||
| `pepper` | `decimal` | **Required** LONGITUDE with 2 decimals digits |
|
| `zlon` | `decimal` | **Required** LONGITUDE with 2 decimals digits |
|
||||||
| `g1pub` | `string` | **Facultative** choose Umap AstroID PASS |
|
| `g1pub` | `string` | **Facultative** choose Umap AstroID PASS |
|
||||||
|
|
||||||
Create à Umap key (LAT/LON), then a PLAYER TW with GPS as Umap IPNS reference
|
Create à Umap key (LAT/LON), then a PLAYER TW with GPS as Umap IPNS reference
|
||||||
This API is used by OSM2IPFS code.
|
This API is used by OSM2IPFS code.
|
||||||
|
|
||||||
UPlanet Entrance : https://qo-op.com
|
* [UPlanet Entrance](https://qo-op.com)
|
||||||
|
|
||||||
### ➤ QRCODE (API SandBox)
|
### ➤ QRCODE (API SandBox)
|
||||||
```http
|
```http
|
||||||
|
83
RUNTIME/DRAGON_p2p_ssh.sh
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
################################################################################
|
||||||
|
# Author: Fred (support@qo-op.com)
|
||||||
|
# Version: 0.2
|
||||||
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
|
################################################################################
|
||||||
|
# Activate SUPPORT MODE: open ssh over IPFS
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
. "$MY_PATH/../tools/my.sh"
|
||||||
|
########################################################################
|
||||||
|
YOU=$(myIpfsApi) || er+=" ipfs daemon not running"
|
||||||
|
[[ "$YOU" == "" || "${IPFSNODEID}" == "" ]] && echo "ERROR : $er " && exit 1
|
||||||
|
########################################################################
|
||||||
|
## THIS SCRIPT COPY BOOSTRAP PUBKEY
|
||||||
|
### AND OPEN IPFS P2P SSH FORWARD ON CHANNEL
|
||||||
|
# Make Station publish SSH port on "/x/ssh-$(IPFSNODEID)"
|
||||||
|
########################################################################
|
||||||
|
## use STOP or OFF to finish forwarding
|
||||||
|
|
||||||
|
PARAM="$1"
|
||||||
|
if [[ "${PARAM,,}" == "off" || "${PARAM,,}" == "stop" ]]; then
|
||||||
|
ipfs p2p close --all
|
||||||
|
rm ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh 2>/dev/null
|
||||||
|
rm ~/.zen/tmp/${IPFSNODEID}/y_ssh.pub 2>/dev/null
|
||||||
|
echo "STOP" && exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
############################################
|
||||||
|
## DISTRIBUTE DRAGON SSH WOT SEED : A_boostrap_ssh.txt
|
||||||
|
############################################
|
||||||
|
while IFS= read -r line
|
||||||
|
do
|
||||||
|
LINE=$(echo "$line" | grep "ssh-ed25519" | grep -Ev "#") # Remove # & not ssh-ed25519
|
||||||
|
[[ ! ${LINE} ]] && continue
|
||||||
|
if [[ ! $(cat ~/.ssh/authorized_keys | grep "${LINE}") ]]
|
||||||
|
then
|
||||||
|
echo "# ADDING ${LINE} to ~/.ssh/authorized_keys"
|
||||||
|
mkdir -p ~/.ssh && echo "${LINE}" >> ~/.ssh/authorized_keys
|
||||||
|
else
|
||||||
|
echo "TRUSTING ${LINE}"
|
||||||
|
fi
|
||||||
|
done < ${MY_PATH}/../A_boostrap_ssh.txt
|
||||||
|
|
||||||
|
############################################
|
||||||
|
## PUBLISH SSH PUBKEY OVER IPFS
|
||||||
|
## KITTY ssh-keygen style
|
||||||
|
[[ -s ~/.ssh/id_ed25519.pub ]] && cp ~/.ssh/id_ed25519.pub ~/.zen/tmp/${IPFSNODEID}/y_ssh.pub
|
||||||
|
## DRAGONz PGP/SSH style (https://pad.p2p.legal/keygen)
|
||||||
|
gpg --export-ssh-key $(cat ~/.zen/game/players/.current/.player) 2>/dev/null > ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub
|
||||||
|
|
||||||
|
############################################
|
||||||
|
### FORWARD SSH PORT over /x/ssh-${IPFSNODEID}
|
||||||
|
############################################
|
||||||
|
echo "Lanching /x/ssh-${IPFSNODEID}"
|
||||||
|
|
||||||
|
[[ ! $(ipfs p2p ls | grep "/x/ssh-${IPFSNODEID}") ]] && ipfs p2p listen /x/ssh-${IPFSNODEID} /ip4/127.0.0.1/tcp/22
|
||||||
|
|
||||||
|
ipfs p2p ls
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "#!/bin/bash"
|
||||||
|
############################################
|
||||||
|
## PREPARE x_ssh.sh
|
||||||
|
## REMOTE ACCESS COMMAND FROM DRAGONS
|
||||||
|
############################################
|
||||||
|
PORT=22000
|
||||||
|
PORT=$((PORT+${RANDOM:0:3}))
|
||||||
|
|
||||||
|
echo "if [[ ! \$(ipfs p2p ls | grep x/ssh-${IPFSNODEID}) ]]; then
|
||||||
|
ipfs --timeout=5s ping -n 1 /p2p/${IPFSNODEID}
|
||||||
|
ipfs p2p forward /x/ssh-${IPFSNODEID} /ip4/127.0.0.1/tcp/$PORT /p2p/${IPFSNODEID}
|
||||||
|
ssh $USER@127.0.0.1 -p $PORT
|
||||||
|
fi" > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
|
||||||
|
|
||||||
|
cat ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
|
||||||
|
|
||||||
|
############################################
|
||||||
|
echo
|
||||||
|
echo "ipfs cat /ipns/${IPFSNODEID}/x_ssh.sh | bash"
|
||||||
|
############################################
|
||||||
|
|
||||||
|
exit 0
|
@ -15,26 +15,25 @@ ME="${0##*/}"
|
|||||||
CESIUM=${myCESIUM}
|
CESIUM=${myCESIUM}
|
||||||
GCHANGE=${myGCHANGE}
|
GCHANGE=${myGCHANGE}
|
||||||
|
|
||||||
echo "(✜‿‿✜) G1PalPay : Receiving & Relaying payments to emails found in comment"
|
|
||||||
echo "$ME RUNNING"
|
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"
|
[[ ! ${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 - Please provide path to source TW index.html" && exit 1
|
||||||
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && 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} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
|
||||||
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
|
[[ ! ${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
|
[[ ! ${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
|
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
|
||||||
|
|
||||||
# Extract tag=tube from TW
|
# Extract tag=tube from TW
|
||||||
@ -47,23 +46,32 @@ MOATS="$3"
|
|||||||
mkdir -p $HOME/.zen/tmp/${IPFSNODEID}/G1PalPay/${PLAYER}/
|
mkdir -p $HOME/.zen/tmp/${IPFSNODEID}/G1PalPay/${PLAYER}/
|
||||||
mkdir -p $HOME/.zen/game/players/${PLAYER}/G1PalPay/
|
mkdir -p $HOME/.zen/game/players/${PLAYER}/G1PalPay/
|
||||||
mkdir -p $HOME/.zen/tmp/${MOATS}
|
mkdir -p $HOME/.zen/tmp/${MOATS}
|
||||||
echo "=========== ( ◕‿◕) (◕‿◕ ) =============="
|
echo "=========== ( ◕‿◕) (◕‿◕ ) ============== ${PLAYER}
|
||||||
|
${INDEX}"
|
||||||
|
echo "(✜‿‿✜) G1PalPay : CHECK LAST 10 TX comment"
|
||||||
|
|
||||||
# CHECK LAST 10 INCOMING PAYMENTS
|
# CHECK LAST 10 INCOMING PAYMENTS
|
||||||
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
|
~/.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
|
${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 ]] \
|
[[ ! -s $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json ]] \
|
||||||
&& echo "NO PAYMENT HISTORY" \
|
&& echo "NO PAYMENT HISTORY.......................... EXIT" \
|
||||||
&& exit 1
|
&& exit 1
|
||||||
##############################
|
##############################
|
||||||
##########################################################
|
##########################################################
|
||||||
############# CHECK FOR N1COMMANDs IN PAYMENT COMMENT
|
############# 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
|
while read prog; do
|
||||||
cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -rc .[] | grep 'N1' > ~/.zen/tmp/${MOATS}/myN1.json
|
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
|
while read NLINE; do
|
||||||
## COMMENT FORMAT = N1$CMD:$TH:$TRAIL
|
## COMMENT FORMAT = N1$CMD:$TH:$TRAIL
|
||||||
TXIDATE=$(echo ${NLINE} | jq -r .date)
|
TXIDATE=$(echo ${NLINE} | jq -r .date)
|
||||||
@ -72,7 +80,10 @@ while read NLINE; do
|
|||||||
COMMENT=$(echo ${NLINE} | jq -r .comment)
|
COMMENT=$(echo ${NLINE} | jq -r .comment)
|
||||||
CMD=$(echo ${COMMENT} | cut -d ':' -f 1 | cut -c -12 ) # Maximum 12 characters CMD
|
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)
|
TH=$(echo ${COMMENT} | cut -d ':' -f 2)
|
||||||
TRAIL=$(echo ${COMMENT} | cut -d ':' -f 3-)
|
TRAIL=$(echo ${COMMENT} | cut -d ':' -f 3-)
|
||||||
@ -114,7 +125,9 @@ while read LINE; do
|
|||||||
COMMENT=$(echo $JSON | jq -r .comment)
|
COMMENT=$(echo $JSON | jq -r .comment)
|
||||||
|
|
||||||
echo ">>> TODO CHECK TX HAPPENS LAST 24H (WHAT IS TXIDATE=$TXIDATE FORMAT ??)"
|
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
|
## 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"))
|
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[@]}"
|
echo "N=${#TXIMAILS[@]}"
|
||||||
N=${#TXIMAILS[@]}
|
N=${#TXIMAILS[@]}
|
||||||
SHARE=$(echo "scale=2; $TXIAMOUNT / $N" | bc)
|
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 %"
|
echo "$TXIDATE $TXIPUBKEY $TXIAMOUNT [$TXIAMOUNTUD] $TXIMAILS % $SHARE %"
|
||||||
|
|
||||||
|
# let's loop over TXIMAILS
|
||||||
for EMAIL in "${TXIMAILS[@]}"; do
|
for EMAIL in "${TXIMAILS[@]}"; do
|
||||||
|
|
||||||
[[ ${EMAIL} == $PLAYER ]] && echo "ME MYSELF" && continue
|
[[ ${EMAIL} == $PLAYER ]] && echo "ME MYSELF" && continue
|
||||||
@ -144,8 +159,8 @@ while read LINE; do
|
|||||||
|
|
||||||
[[ ! ${ASTROG1} ]] \
|
[[ ! ${ASTROG1} ]] \
|
||||||
&& echo "<html><body><h1>SORRY ${EMAIL} YOUR ACCOUNT IS MISSING</h1>" \
|
&& 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 \
|
&& 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 "NEED FOR ACCOUNT" \
|
&& ${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/palpay.bro "MISSING ACCOUNT" \
|
||||||
&& continue
|
&& continue
|
||||||
|
|
||||||
|
|
||||||
@ -183,22 +198,27 @@ echo "=========== %%%%% (°▃▃°) %%%%%%% =============="
|
|||||||
echo "# EXTRACT TODAY TIDDLERS"
|
echo "# EXTRACT TODAY TIDDLERS"
|
||||||
tiddlywiki --load ${INDEX} \
|
tiddlywiki --load ${INDEX} \
|
||||||
--output ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/ \
|
--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
|
## 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 | jq -rc # LOG
|
||||||
|
|
||||||
cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/today.${PLAYER}.tiddlers.json \
|
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
|
# LOG
|
||||||
cat ~/.zen/tmp/${MOATS}/@tags.json
|
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
|
#~ 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
|
while read LINE; do
|
||||||
|
|
||||||
echo "---------------------------------- Sava PalPé mec"
|
echo "---------------------------------- Sava PalPé mec"
|
||||||
@ -220,7 +240,7 @@ while read LINE; do
|
|||||||
## Count emails found
|
## Count emails found
|
||||||
emails=($(echo "$TTAGS" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
|
emails=($(echo "$TTAGS" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
|
||||||
nb=${#emails[@]}
|
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
|
## Get first zmail
|
||||||
ZMAIL="${emails}"
|
ZMAIL="${emails}"
|
||||||
|
@ -38,7 +38,8 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
|
|||||||
cp -f ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/COINS/
|
cp -f ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/COINS/
|
||||||
|
|
||||||
## COPY 20h12.log
|
## 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
|
## COPY FRIENDS
|
||||||
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
|
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
|
||||||
@ -51,7 +52,12 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
|
|||||||
cp -Rf ~/.zen/game/players/${PLAYER}/FRIENDS/* ~/.zen/tmp/${IPFSNODEID}/GCHANGE/${PLAYER}/FRIENDS/ 2>/dev/null
|
cp -Rf ~/.zen/game/players/${PLAYER}/FRIENDS/* ~/.zen/tmp/${IPFSNODEID}/GCHANGE/${PLAYER}/FRIENDS/ 2>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
cp ~/.zen/GPS ~/.zen/tmp/${IPFSNODEID}/
|
## INFORM GPS LOCATION
|
||||||
|
[[ -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
|
## REFRESH TIMESTAMPING
|
||||||
echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
|
echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
|
||||||
@ -67,7 +73,7 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## CLEANING SWARM 30 DAYS OLD
|
## CLEANING SWARM 3 DAYS OLD
|
||||||
find ~/.zen/tmp/swarm/ -mtime +30 -type d -exec rm -Rf '{}' \;
|
find ~/.zen/tmp/swarm/ -mtime +3 -type d -exec rm -Rf '{}' \;
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -44,7 +44,7 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
|
|
||||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
mkdir -p ~/.zen/tmp/${MOATS}
|
mkdir -p ~/.zen/tmp/${MOATS}
|
||||||
|
echo "##################################################################"
|
||||||
echo "##################################################################"
|
echo "##################################################################"
|
||||||
echo ">>>>> PLAYER : ${PLAYER} >>>>>>>>>>>>> REFRESHING TW STATION"
|
echo ">>>>> PLAYER : ${PLAYER} >>>>>>>>>>>>> REFRESHING TW STATION"
|
||||||
echo "##################################################################"
|
echo "##################################################################"
|
||||||
@ -52,13 +52,13 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
|
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
|
||||||
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
|
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
|
||||||
# Get PLAYER wallet amount
|
# 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)
|
ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1)
|
||||||
echo "+++ WALLET BALANCE _ $COINS (G1) _ / $ZEN ZEN /"
|
echo "+++ WALLET BALANCE _ $COINS (G1) _ / $ZEN ZEN /"
|
||||||
|
|
||||||
#~ ## ZENCARD ARE ACTIVATED WITH 1 G1 + 10 ZEN (= 1 €OC) ?
|
#~ ## ZENCARD ARE ACTIVATED WITH 1 G1 + 10 ZEN (= 1 €OC) ?
|
||||||
echo "##################################################################"
|
|
||||||
|
|
||||||
echo "##################################################################"
|
echo "##################################################################"
|
||||||
echo "################### REFRESH ASTRONAUTE TW ###########################"
|
echo "################### REFRESH ASTRONAUTE TW ###########################"
|
||||||
echo "##################################################################"
|
echo "##################################################################"
|
||||||
@ -122,7 +122,7 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
|
|
||||||
[[ $try == 0 ]] \
|
[[ $try == 0 ]] \
|
||||||
&& echo "PLAYER ${PLAYER} UNPLUG" \
|
&& 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
|
&& continue
|
||||||
|
|
||||||
try=$((try-1))
|
try=$((try-1))
|
||||||
@ -170,16 +170,25 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
--output ~/.zen/tmp/${MOATS} \
|
--output ~/.zen/tmp/${MOATS} \
|
||||||
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
|
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
|
||||||
UMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
|
UMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
|
||||||
[[ $UMAPNS == "null" ]] && UMAPNS="/ipns/k51qzi5uqu5djg1gqzujq5p60w25mi235gdg0lgkk5qztkfrpi5c22oolrriyu"
|
[[ $UMAPNS == "null" || $UMAPNS == "" ]] && UMAPNS="/ipns/k51qzi5uqu5djg1gqzujq5p60w25mi235gdg0lgkk5qztkfrpi5c22oolrriyu"
|
||||||
LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
|
LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
|
||||||
[[ $LAT == "null" ]] && LAT="0.00"
|
[[ $LAT == "null" || $LAT == "" ]] && LAT="0.00"
|
||||||
LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
|
LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
|
||||||
[[ $LON == "null" ]] && LON="0.00"
|
[[ $LON == "null" || $LON == "" ]] && LON="0.00"
|
||||||
|
|
||||||
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${UMAPNS}"
|
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
|
||||||
|
|
||||||
## STORE IN PLAYER CACHE
|
## STORE IN PLAYER CACHE
|
||||||
echo "_${LAT}_${LON}" > ~/.zen/game/players/${PLAYER}/.umap
|
echo "_${LAT}_${LON}" > ~/.zen/game/players/${PLAYER}/.umap
|
||||||
|
cp ~/.zen/tmp/${MOATS}/GPS.json ~/.zen/game/players/${PLAYER}/
|
||||||
|
|
||||||
########### ASTROPORT is not IPFSNODEID => EJECT TW
|
########### ASTROPORT is not IPFSNODEID => EJECT TW
|
||||||
## MOVED PLAYER (KEY IS KEPT ON LAST CONNECTED ASTROPORT)
|
## MOVED PLAYER (KEY IS KEPT ON LAST CONNECTED ASTROPORT)
|
||||||
@ -189,7 +198,7 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
if [[ ${IPNSTAIL} != ${IPFSNODEID} || ${IPNSTAIL} == "_ASTROPORT_" ]]; then
|
if [[ ${IPNSTAIL} != ${IPFSNODEID} || ${IPNSTAIL} == "_ASTROPORT_" ]]; then
|
||||||
echo "> I AM ${IPFSNODEID} : PLAYER MOVED TO ${IPNSTAIL} : EJECTION "
|
echo "> I AM ${IPFSNODEID} : PLAYER MOVED TO ${IPNSTAIL} : EJECTION "
|
||||||
echo "UNPLUG PLAYER"
|
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"
|
echo ">>>> ASTRONAUT ${PLAYER} TW CAPSULE EJECTION TERMINATED"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@ -202,34 +211,36 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
##############################################################
|
##############################################################
|
||||||
echo "##################################################################"
|
echo "##################################################################"
|
||||||
|
|
||||||
[[ $(echo "$COINS > 2" | bc -l) -eq 1 ]] \
|
[[ $(echo "$COINS >= 2" | bc -l) -eq 1 ]] \
|
||||||
&& echo "## Connect_PLAYER_To_Gchange.sh" \
|
&& echo "## Connect_PLAYER_To_Gchange.sh" \
|
||||||
&& ${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}" \
|
&& ${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}" \
|
||||||
|| echo "1 G1 + 10 ẑen needed to activate ★★★★★ system"
|
|| echo "1 G1 + 10 ẑen needed to activate ★★★★★ system"
|
||||||
|
|
||||||
# G1PalPay - 1 G1 + 10 ZEN mini -> Check for G1 TX incoming comments #
|
# G1PalPay - 1 G1 mini -> Check for G1 TX incoming comments #
|
||||||
[[ $(echo "$COINS > 1" | bc -l) -eq 1 ]] \
|
if [[ $(echo "$COINS >= 1" | bc -l) -eq 1 ]]; then
|
||||||
&& echo "## RUNNING G1PalPay Wallet Monitoring " \
|
###########
|
||||||
&& ${MY_PATH}/G1PalPay.sh ${HOME}/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}" \
|
# G1PalPay.sh #
|
||||||
|| echo "> ZenCard is not activated ($ZEN)"
|
##############################################################
|
||||||
|
echo "## RUNNING G1PalPay Wallet Monitoring "
|
||||||
### CHECK FOR pending (TODO! In case PAY4SURE have abandonned pendings)
|
${MY_PATH}/G1PalPay.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}"
|
||||||
|
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# VOEUX.create.sh #
|
# 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}"
|
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}" "${G1PUB}"
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# VOEUX.refresh.sh #
|
# VOEUX.refresh.sh #
|
||||||
##############################################################
|
##############################################################
|
||||||
## RUN ASTROBOT G1Voeux SUBPROCESS (SPECIFIC Ŋ1 COPY)
|
|
||||||
##############################################################
|
|
||||||
${MY_PATH}/VOEUX.refresh.sh "${PLAYER}" "${MOATS}" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
|
${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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# REFRESH PLAYER_feed #
|
# REFRESH PLAYER_feed #
|
||||||
##################################
|
##################################
|
||||||
@ -294,8 +305,8 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
##################################################
|
############################### LOCAL "MICRO LEDGER"
|
||||||
################## UPDATING PLAYER MOA
|
################## UPDATING ${PLAYER}/ipfs/moa
|
||||||
[[ $DIFF ]] && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \
|
[[ $DIFF ]] && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \
|
||||||
~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
|
~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
|
||||||
|
|
||||||
@ -315,7 +326,11 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
## CREATING 30 DAYS JSON RSS STREAM
|
## CREATING 30 DAYS JSON RSS STREAM
|
||||||
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
|
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
|
||||||
--output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${PLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]]'
|
--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 -"
|
|
||||||
|
[[ ! -s ~/.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
|
## TODO CREATING 30 DAYS XML RSS STREAM
|
||||||
## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/26
|
## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/26
|
||||||
@ -328,12 +343,13 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
SNOW=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
|
SNOW=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
|
||||||
DIFF_SECONDS=$(( SNOW - SBIRTH ))
|
DIFF_SECONDS=$(( SNOW - SBIRTH ))
|
||||||
days=$((DIFF_SECONDS / 60 / 60 / 24))
|
days=$((DIFF_SECONDS / 60 / 60 / 24))
|
||||||
echo "PLAYER TW was created $days ago"
|
echo "PLAYER TW was created $days days ago"
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
#### PLAYER ACCOUNT CLEANING #########
|
#### PLAYER ACCOUNT CLEANING #########
|
||||||
## IF ZEN < 11
|
## IF ZEN < 11
|
||||||
## && EMPTY RSS + 30 DAYS BIRTHDATE
|
## && EMPTY RSS + 30 DAYS BIRTHDATE
|
||||||
|
## only for less 90 days TW ? && ${DIFF_SECONDS} -lt $(( 90 * 24 * 60 * 60 )) ????
|
||||||
## ==> UNPLUG
|
## ==> UNPLUG
|
||||||
[[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" ]] \
|
[[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" ]] \
|
||||||
&& echo "RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN --" \
|
&& echo "RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN --" \
|
||||||
@ -345,7 +361,7 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
&& echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days" \
|
&& echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days" \
|
||||||
&& [[ ${DIFF_SECONDS} -gt $(( 30 * 24 * 60 * 60 )) ]] \
|
&& [[ ${DIFF_SECONDS} -gt $(( 30 * 24 * 60 * 60 )) ]] \
|
||||||
&& echo ">>>> PLAYER TW UNPLUG >>>>> ${days} days => BYE BYE ${PLAYER} ZEN=$ZEN" \
|
&& 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
|
&& continue
|
||||||
#################################### UNPLUG ACCOUNT
|
#################################### UNPLUG ACCOUNT
|
||||||
|
|
||||||
@ -360,7 +376,9 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${IRSS}'\" />${PLAYER}" \
|
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${IRSS}'\" />${PLAYER}" \
|
||||||
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html
|
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html
|
||||||
|
|
||||||
|
#################################################
|
||||||
|
################### COPY DATA TO UP LEVEL GRIDS
|
||||||
|
#################################################
|
||||||
if [[ ${LAT} && ${LON} ]]; then
|
if [[ ${LAT} && ${LON} ]]; then
|
||||||
## SECTOR BANK COORD
|
## SECTOR BANK COORD
|
||||||
SECLAT="${LAT::-1}"
|
SECLAT="${LAT::-1}"
|
||||||
@ -369,6 +387,7 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
|
REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
|
||||||
REGLON=$(echo ${LON} | cut -d '.' -f 1)
|
REGLON=$(echo ${LON} | cut -d '.' -f 1)
|
||||||
|
|
||||||
|
echo "/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}"
|
||||||
## IPFSNODEID 12345 CACHE UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
|
## IPFSNODEID 12345 CACHE UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
|
||||||
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
|
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
|
||||||
|
|
||||||
@ -378,7 +397,8 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
${MY_PATH}/../tools/json_dir.all.sh ~/.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}
|
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}/
|
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='${UMAPNS}'\" />" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html
|
|
||||||
|
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${TODATENS}'\" />" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -394,6 +414,7 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||||||
|
|
||||||
## CLEANING CACHE
|
## CLEANING CACHE
|
||||||
rm -Rf ~/.zen/tmp/${MOATS}
|
rm -Rf ~/.zen/tmp/${MOATS}
|
||||||
|
echo
|
||||||
|
|
||||||
done
|
done
|
||||||
echo "============================================ PLAYER.refresh DONE."
|
echo "============================================ PLAYER.refresh DONE."
|
||||||
|
@ -72,7 +72,7 @@ mkdir -p ~/.zen/tmp/${MOATS}
|
|||||||
|
|
||||||
## SEND PLAYER LAST KNOW TW
|
## SEND PLAYER LAST KNOW TW
|
||||||
TW=$(ipfs add -Hq ${INDEX} | tail -n 1)
|
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 "PLAYER IPNS KEYS UNPLUGED"
|
||||||
echo "#######################"
|
echo "#######################"
|
@ -12,7 +12,15 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|||||||
# UMAP > SECTOR > REGION
|
# UMAP > SECTOR > REGION
|
||||||
## Get from 100 sectors tiddlers with more than 2 signatures
|
## Get from 100 sectors tiddlers with more than 2 signatures
|
||||||
############################################
|
############################################
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo "############################################"
|
||||||
|
echo "############################################"
|
||||||
|
echo "############################################"
|
||||||
echo "# # # # RUNNING REGION.refresh"
|
echo "# # # # RUNNING REGION.refresh"
|
||||||
|
echo "############################################"
|
||||||
|
echo "############################################"
|
||||||
|
echo "############################################"
|
||||||
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
|
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
|
||||||
|
|
||||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
@ -83,7 +91,7 @@ for REGION in ${REGIONS[@]}; do
|
|||||||
TODATEREGIONNS=$(ipfs key import ${TODATE}${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
|
TODATEREGIONNS=$(ipfs key import ${TODATE}${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
|
||||||
##############################################################
|
##############################################################
|
||||||
## GET from IPNS
|
## GET from IPNS
|
||||||
ipfs --timeout 180s get -o ~/.zen/tmp/${MOATS}/${REGION}/ /ipns/${REGIONNS}/
|
ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${REGION}/ /ipns/${YESTERDATEREGIONNS}/
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
mkdir -p ~/.zen/tmp/${MOATS}/${REGION}/RSS
|
mkdir -p ~/.zen/tmp/${MOATS}/${REGION}/RSS
|
||||||
@ -91,7 +99,7 @@ for REGION in ${REGIONS[@]}; do
|
|||||||
rm -f ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
|
rm -f ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
|
||||||
|
|
||||||
## START WITH LOCAL SECTORS RSS WEEK
|
## 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
|
for RSS in ${RSSNODE[@]}; do
|
||||||
[[ $(cat ${RSS}) != "[]" ]] \
|
[[ $(cat ${RSS}) != "[]" ]] \
|
||||||
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
|
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
|
||||||
@ -100,7 +108,7 @@ for REGION in ${REGIONS[@]}; do
|
|||||||
NL=${#RSSNODE[@]}
|
NL=${#RSSNODE[@]}
|
||||||
|
|
||||||
## ADD SWARM SECTORS RSS WEEK
|
## 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
|
for RSS in ${RSSWARM[@]}; do
|
||||||
[[ $(cat ${RSS}) != "[]" ]] \
|
[[ $(cat ${RSS}) != "[]" ]] \
|
||||||
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
|
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
|
||||||
@ -118,14 +126,24 @@ for REGION in ${REGIONS[@]}; do
|
|||||||
mv ~/.zen/tmp/${MOATS}/${REGION}/RSS/.all.json \
|
mv ~/.zen/tmp/${MOATS}/${REGION}/RSS/.all.json \
|
||||||
~/.zen/tmp/${MOATS}/${REGION}/RSS/_${REGLAT}_${REGLON}.week.rss.json
|
~/.zen/tmp/${MOATS}/${REGION}/RSS/_${REGLAT}_${REGLON}.week.rss.json
|
||||||
|
|
||||||
## PREPARING AiApi link
|
## PREPARING JOURNAL
|
||||||
mkdir -p ~/.zen/tmp/${IPFSNODEID}/REGIONS
|
|
||||||
|
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)
|
RWEEKCID=$(ipfs add -q ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL)
|
||||||
|
|
||||||
cp ~/.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='/ipns/${TODATEREGIONNS}'\" />" \
|
||||||
|
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}/_index.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rm ~/.zen/tmp/${IPFSNODEID}/REGIONS/_${REGLAT}_${REGLON}.week.cid 2>/dev/null ## TODO REMOVE
|
|
||||||
|
|
||||||
## DEMO : PREPARE Ask.IA link - PROD will be launched during RUNTIME.
|
## 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}'\" />" \
|
echo "<meta http-equiv=\"refresh\" content=\"0; url='https://api.copylaradio.com/tellme/?cid=/ipfs/${RWEEKCID}'\" />" \
|
||||||
@ -136,11 +154,10 @@ for REGION in ${REGIONS[@]}; do
|
|||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
echo "Numbers of REGION WEEK RSS : ${NL} + ${NS} : "${TOTL}
|
echo "Numbers of REGION WEEK RSS : ${NL} + ${NS} : "${TOTL}
|
||||||
|
|
||||||
echo "SHOW TROPHY" > ~/.zen/tmp/${MOATS}/${REGION}/TODO
|
rm ~/.zen/tmp/${MOATS}/${REGION}/TODO
|
||||||
|
rm ~/.zen/tmp/${MOATS}/${REGION}/N_*
|
||||||
|
|
||||||
rm ~/.zen/tmp/${MOATS}/${REGION}/RWEEKCID 2>/dev/null ## TODO REMOVE
|
echo ${TOTL} > ~/.zen/tmp/${MOATS}/${REGION}/N_${TOTL}
|
||||||
|
|
||||||
echo ${TOTL} > ~/.zen/tmp/${MOATS}/${REGION}/N
|
|
||||||
|
|
||||||
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${RWEEKCID}'\" />" \
|
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${RWEEKCID}'\" />" \
|
||||||
> ~/.zen/tmp/${MOATS}/${REGION}/Journal._${REGLAT}_${REGLON}.redir.html
|
> ~/.zen/tmp/${MOATS}/${REGION}/Journal._${REGLAT}_${REGLON}.redir.html
|
||||||
@ -149,7 +166,7 @@ rm ~/.zen/tmp/${MOATS}/${REGION}/RWEEKCID 2>/dev/null ## TODO REMOVE
|
|||||||
ipfs name publish -k ${TODATE}${REGIONG1PUB} /ipfs/${IPFSPOP}
|
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
|
done
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
ME="${0##*/}"
|
ME="${0##*/}"
|
||||||
|
. "$MY_PATH/../tools/my.sh"
|
||||||
|
|
||||||
RSS=$1 ## filepath to RSS
|
RSS=$1 ## filepath to RSS
|
||||||
SECTOR=$2 ## Sector identifier _0.0_0.0
|
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} \
|
&& sed "s~_SECTOR_~${SECTOR}~g" ${MY_PATH}/../templates/twsector.html > ${INDEX} \
|
||||||
&& echo "REFRESHING SECTOR FROM empty TEMPLATE *****"
|
&& echo "REFRESHING SECTOR FROM empty TEMPLATE *****"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo
|
||||||
## EXTRACT PLAYER FROM RSS FILE NAME
|
## EXTRACT PLAYER FROM RSS FILE NAME
|
||||||
PLAYER=$(echo ${RSS} | rev | cut -d '/' -f 1 | rev | sed "s~.rss.json~~g")
|
PLAYER=$(echo ${RSS} | rev | cut -d '/' -f 1 | rev | sed "s~.rss.json~~g")
|
||||||
## GET PLAYER INFORMATION
|
## GET PLAYER INFORMATION
|
||||||
@ -136,7 +138,17 @@ while read title; do
|
|||||||
|
|
||||||
for email in "${unique_combined[@]}"; do
|
for email in "${unique_combined[@]}"; do
|
||||||
|
|
||||||
echo "<html><body>
|
echo "<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'Courier New', monospace;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
</style></head>
|
||||||
|
<body>
|
||||||
<h1>(ᵔ◡◡ᵔ)</h1>
|
<h1>(ᵔ◡◡ᵔ)</h1>
|
||||||
|
|
||||||
Tiddler with same title is existing in ${unique_combined[*]} TW(s)
|
Tiddler with same title is existing in ${unique_combined[*]} TW(s)
|
||||||
@ -153,7 +165,7 @@ To Accept<br>
|
|||||||
To Refuse<br>
|
To Refuse<br>
|
||||||
${NUNIQUE[*]} must fork by deleting or modifying New Tiddler title.
|
${NUNIQUE[*]} must fork by deleting or modifying New Tiddler title.
|
||||||
<br>
|
<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
|
</body></html>" > ~/.zen/tmp/${MOATS}/g1message
|
||||||
|
|
||||||
${MY_PATH}/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "TIDDLER COLLISION"
|
${MY_PATH}/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "TIDDLER COLLISION"
|
@ -12,7 +12,13 @@ start=`date +%s`
|
|||||||
## SECTOR REFRESH
|
## SECTOR REFRESH
|
||||||
# SHARE & UPDATE IPNS TOGETHER
|
# SHARE & UPDATE IPNS TOGETHER
|
||||||
############################################
|
############################################
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo "############################################"
|
||||||
|
echo "############################################"
|
||||||
echo "> RUNNING SECTOR.refresh"
|
echo "> RUNNING SECTOR.refresh"
|
||||||
|
echo "############################################"
|
||||||
|
echo "############################################"
|
||||||
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
|
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
|
||||||
|
|
||||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
@ -71,14 +77,12 @@ for SECTOR in ${SECTORS[@]}; do
|
|||||||
|
|
||||||
###################### SPATIO TEMPORAL KEYS
|
###################### SPATIO TEMPORAL KEYS
|
||||||
## YESTERDATE ###############
|
## YESTERDATE ###############
|
||||||
YESTERDATE=$(date -d "yesterday 13:00" '+%Y-%m-%d')
|
|
||||||
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${SECTOR}" "${YESTERDATE}${UPLANETNAME}${SECTOR}"
|
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${SECTOR}" "${YESTERDATE}${UPLANETNAME}${SECTOR}"
|
||||||
ipfs key rm ${YESTERDATE}${G1PUB} > /dev/null 2>&1
|
ipfs key rm ${YESTERDATE}${G1PUB} > /dev/null 2>&1
|
||||||
YESTERDATENS=$(ipfs key import ${YESTERDATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv)
|
YESTERDATENS=$(ipfs key import ${YESTERDATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv)
|
||||||
echo "YESTERDAY : ${myIPFS}/ipns/${YESTERDATENS}"
|
echo "YESTERDAY : ${myIPFS}/ipns/${YESTERDATENS}"
|
||||||
|
|
||||||
## TODATE #########################################
|
## TODATE #########################################
|
||||||
TODATE=$(date -d "today 13:00" '+%Y-%m-%d')
|
|
||||||
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
|
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
|
||||||
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
|
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
|
||||||
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
|
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
|
||||||
@ -87,8 +91,8 @@ for SECTOR in ${SECTORS[@]}; do
|
|||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
start=`date +%s`
|
start=`date +%s`
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
#~ ## IPFS GET ONLINE SECTORNS
|
#~ ## IPFS GET ONLINE YESTERDATE SECTORNS
|
||||||
ipfs --timeout 180s get -o ~/.zen/tmp/${MOATS}/${SECTOR}/ /ipns/${YESTERDATENS}/
|
ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${SECTOR}/ /ipns/${YESTERDATENS}/
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
echo "_____SECTOR${SECTOR} GET time was "`expr $end - $start` seconds.
|
echo "_____SECTOR${SECTOR} GET time was "`expr $end - $start` seconds.
|
||||||
@ -107,14 +111,7 @@ for SECTOR in ${SECTORS[@]}; do
|
|||||||
minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
|
minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
|
||||||
seconds=$((DIFF_SECONDS % 60))
|
seconds=$((DIFF_SECONDS % 60))
|
||||||
echo "SECTOR DATA is ${hours} hours ${minutes} minutes ${seconds} seconds OLD"
|
echo "SECTOR DATA is ${hours} hours ${minutes} minutes ${seconds} seconds OLD"
|
||||||
if [ ${DIFF_SECONDS} -lt $(( 5 * 60 * 60 )) ]; then
|
|
||||||
echo "GETTING YESTERDAY SECTOR.refresher"
|
|
||||||
YESTERDAY=$(ipfs cat /ipfs/${ZCHAIN}/CHAIN/SECTOR.refresher | head -n 1)
|
|
||||||
## GET UMAP.refresher from PREVIOUS _chain ...
|
|
||||||
echo "TODAY : $(cat ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/SECTOR.refresher | head -n 1)"
|
|
||||||
echo "YESTERDAY : ${YESTERDAY}"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
## CONTROL ACTINGNODE SWAPPING
|
## CONTROL ACTINGNODE SWAPPING
|
||||||
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/SECTOR.refresher"
|
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/SECTOR.refresher"
|
||||||
@ -133,14 +130,14 @@ for SECTOR in ${SECTORS[@]}; do
|
|||||||
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
|
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
|
||||||
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
|
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
|
||||||
|
|
||||||
## IF NOT UPDATED FOR TOO LONG
|
## IF NOT UPDATED FOR TOO LONG : STRAPS[0] get key control
|
||||||
[ ${DIFF_SECONDS} -gt $(( 24 * 60 * 60 )) ] \
|
[ ${DIFF_SECONDS} -gt $(( 26 * 60 * 60 )) ] \
|
||||||
&& echo "More than 24H update" \
|
&& echo "More than 26H update" \
|
||||||
&& ACTINGNODE=${STRAPS[0]}
|
&& ACTINGNODE=${STRAPS[0]}
|
||||||
|
|
||||||
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
|
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
|
||||||
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
|
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
|
||||||
&& continue
|
&& ipfs key rm ${TODATE}${G1PUB} ${YESYERDATE}${G1PUB} ${G1PUB}; continue
|
||||||
|
|
||||||
### NEXT REFRESHER SHUFFLE
|
### NEXT REFRESHER SHUFFLE
|
||||||
rm ${UREFRESH}
|
rm ${UREFRESH}
|
||||||
@ -160,16 +157,17 @@ for SECTOR in ${SECTORS[@]}; do
|
|||||||
## NEW TW TEMPLATE
|
## NEW TW TEMPLATE
|
||||||
[[ ! -s ${INDEX} ]] \
|
[[ ! -s ${INDEX} ]] \
|
||||||
&& sed "s~_SECTOR_~${SECTOR}~g" ${MY_PATH}/../templates/twsector.html > ${INDEX} \
|
&& sed "s~_SECTOR_~${SECTOR}~g" ${MY_PATH}/../templates/twsector.html > ${INDEX} \
|
||||||
&& echo "REFRESHING SECTOR FROM empty TEMPLATE *****"
|
&& echo "REFRESHING SECTOR FROM empty TEMPLATE *****" \
|
||||||
|
&& [[ ${IPFSNODEID} != ${STRAPS[0]} ]] && echo "1ST BOOSTRAP JOB" && continue
|
||||||
|
|
||||||
## SET SECTOR
|
## SET SECTOR
|
||||||
sed -i "s~_SECTOR_~${SECTOR}~g" ${INDEX}
|
sed -i "s~_SECTOR_~${SECTOR}~g" ${INDEX}
|
||||||
|
|
||||||
## GET ALL RSS json's AND Feed SECTOR TW with it
|
## GET ALL RSS json's AND Feed SECTOR TW with it
|
||||||
RSSNODE=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/RSS/*.rss.json 2>/dev/null))
|
RSSNODE=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/RSS/*.rss.json 2>/dev/null))
|
||||||
NL=${#RSSNODE[@]}
|
NL=${#RSSNODE[@]}
|
||||||
|
|
||||||
RSSWARM=($(ls ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/RSS/*.rss.json 2>/dev/null))
|
RSSWARM=($(ls ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/RSS/*.rss.json 2>/dev/null))
|
||||||
NS=${#RSSWARM[@]}
|
NS=${#RSSWARM[@]}
|
||||||
|
|
||||||
combinedrss=("${RSSNODE[@]}" "${RSSWARM[@]}")
|
combinedrss=("${RSSNODE[@]}" "${RSSWARM[@]}")
|
||||||
@ -177,15 +175,22 @@ for SECTOR in ${SECTORS[@]}; do
|
|||||||
|
|
||||||
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/RSS
|
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/RSS
|
||||||
rm -f ~/.zen/tmp/${MOATS}/${SECTOR}/RSS/_all.json
|
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
|
for RSS in ${RSSALL[@]}; do
|
||||||
|
############################################################
|
||||||
## Extract New Tiddlers and maintain fusion in Sector TW.
|
## 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
|
## create sector RSS _all.json
|
||||||
cat ${RSS} >> ~/.zen/tmp/${MOATS}/${SECTOR}/RSS/_all.json
|
cat ${RSS} >> ~/.zen/tmp/${MOATS}/${SECTOR}/RSS/_all.json
|
||||||
|
############################################################
|
||||||
done
|
done
|
||||||
TOTL=$((${NL}+${NS}))
|
TOTL=$((${NL}+${NS}))
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
# Update COIN & ZEN value
|
# Update COIN & ZEN value
|
||||||
echo ${COINS} > ~/.zen/tmp/${MOATS}/${SECTOR}/COINS
|
echo ${COINS} > ~/.zen/tmp/${MOATS}/${SECTOR}/COINS
|
||||||
echo ${ZEN} > ~/.zen/tmp/${MOATS}/${SECTOR}/ZEN
|
echo ${ZEN} > ~/.zen/tmp/${MOATS}/${SECTOR}/ZEN
|
||||||
@ -242,35 +247,6 @@ for SECTOR in ${SECTORS[@]}; do
|
|||||||
|
|
||||||
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
|
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
|
||||||
echo "JSON WISH WORLD READY /ipfs/${IAMAP}/world.js"
|
echo "JSON WISH WORLD READY /ipfs/${IAMAP}/world.js"
|
||||||
###########################################################################################
|
|
||||||
### APPLY ON APP MODEL TODATE REGIONNS LINKING
|
|
||||||
REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
|
|
||||||
REGLON=$(echo ${LON} | cut -d '.' -f 1)
|
|
||||||
REGION="_${REGLAT}_${REGLON}"
|
|
||||||
TODATEREGIONNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}")
|
|
||||||
|
|
||||||
PHONEBOOTH="${G1PUB::30}"
|
|
||||||
cat ${MY_PATH}/../templates/UPlanetSector/index.html \
|
|
||||||
| sed -e "s~_ZONE_~SECTOR ${SECTOR}~g" \
|
|
||||||
-e "s~_UPZONE_~REGION ${REGION}~g" \
|
|
||||||
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
|
|
||||||
-e "s~_ZONENS_~${TODATENS}~g" \
|
|
||||||
-e "s~_UPZONENS_~${TODATEREGIONNS}~g" \
|
|
||||||
-e "s~_SECTORG1PUB_~${G1PUB}~g" \
|
|
||||||
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
|
|
||||||
-e "s~_LAT_~${REGLAT}~g" \
|
|
||||||
-e "s~_LON_~${REGLON}~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}\°=0.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
|
|
||||||
|
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
## ADD SECTOR ZENPUB.png & INFO.png
|
## ADD SECTOR ZENPUB.png & INFO.png
|
||||||
@ -286,12 +262,44 @@ composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/${MOATS}/ZE
|
|||||||
|
|
||||||
## zday marking
|
## zday marking
|
||||||
rm ~/.zen/tmp/${MOATS}/${SECTOR}/z* 2>/dev/null
|
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
|
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)
|
||||||
|
REGION="_${REGLAT}_${REGLON}"
|
||||||
|
TODATEREGIONNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}")
|
||||||
|
|
||||||
|
PHONEBOOTH="${G1PUB::30}"
|
||||||
|
cat ${MY_PATH}/../templates/UPlanetSector/index.html \
|
||||||
|
| sed -e "s~_ZONE_~SECTOR ${SECTOR}~g" \
|
||||||
|
-e "s~_UPZONE_~REGION ${REGION}~g" \
|
||||||
|
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
|
||||||
|
-e "s~_ZONENS_~${TODATENS}~g" \
|
||||||
|
-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_~${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}\°=1~g" \
|
||||||
|
-e "s~http://127.0.0.1:8080~~g" \
|
||||||
|
> ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html
|
||||||
|
|
||||||
|
##################################
|
||||||
|
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
|
###################################################### CHAINING BACKUP
|
||||||
IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1)
|
IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## DOES CHAIN CHANGED or INIT ?
|
## DOES CHAIN CHANGED or INIT ?
|
||||||
[[ ${ZCHAIN} != ${IPFSPOP} || ${ZCHAIN} == "" ]] \
|
[[ ${ZCHAIN} != ${IPFSPOP} || ${ZCHAIN} == "" ]] \
|
||||||
&& echo "${MOATS}:${IPFSNODEID}:${IPFSPOP}" > ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain \
|
&& echo "${MOATS}:${IPFSNODEID}:${IPFSPOP}" > ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain \
|
||||||
@ -299,10 +307,10 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />${TODATE
|
|||||||
&& IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1) && echo "ROOT was ${ZCHAIN}"
|
&& IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1) && echo "ROOT was ${ZCHAIN}"
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
echo "% START PUBLISHING ${SECTOR} ${myIPFS}/ipns/${SECTORNS}"
|
echo "% START PUBLISHING ${SECTOR} ${myIPFS}/ipns/${TODATENS}"
|
||||||
start=`date +%s`
|
start=`date +%s`
|
||||||
ipfs name publish -k ${TODATE}${G1PUB} /ipfs/${IPFSPOP}
|
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`
|
end=`date +%s`
|
||||||
echo "_____SECTOR${SECTOR} PUBLISH time was "`expr $end - $start` seconds.
|
echo "_____SECTOR${SECTOR} PUBLISH time was "`expr $end - $start` seconds.
|
||||||
|
|
||||||
@ -312,11 +320,16 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />${TODATE
|
|||||||
## EXTRACT SECTOR LAST WEEK TIDDLERS TO IPFSNODEID CACHE
|
## EXTRACT SECTOR LAST WEEK TIDDLERS TO IPFSNODEID CACHE
|
||||||
echo "(☉_☉ ) ${REGION}.week.rss.json (☉_☉ )"
|
echo "(☉_☉ ) ${REGION}.week.rss.json (☉_☉ )"
|
||||||
|
|
||||||
mkdir -p ~/.zen/tmp/${IPFSNODEID}/SECTORS/
|
rm -Rf ~/.zen/tmp/${IPFSNODEID}/SECTORS/ ## TODO REMOVE
|
||||||
rm -f ~/.zen/tmp/${IPFSNODEID}/SECTORS/${SECTOR}.week.rss.json
|
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON}
|
||||||
## CREATING 7 DAYS JSON RSS STREAM
|
## CREATING 7 DAYS JSON RSS STREAM
|
||||||
tiddlywiki --load ${INDEX} \
|
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='/ipns/${TODATENS}'\" />" \
|
||||||
|
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON}/_index.html
|
||||||
|
|
||||||
## TODO FILTER INFORMATION WITH MULTIPLE SIGNATURES (DONE in REGION.refresh.sh)
|
## 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
|
## TODO EXPORT AS RSS ## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/28
|
||||||
|
@ -11,7 +11,12 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|||||||
## SEEK FOR UPLANET KEYS
|
## SEEK FOR UPLANET KEYS
|
||||||
# GET & UPDATE IPNS
|
# GET & UPDATE IPNS
|
||||||
############################################
|
############################################
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo "############################################"
|
||||||
echo "## RUNNING UPLANET.refresh"
|
echo "## RUNNING UPLANET.refresh"
|
||||||
|
echo "############################################"
|
||||||
|
echo "############################################"
|
||||||
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
|
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
|
||||||
|
|
||||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
@ -23,8 +28,8 @@ mkdir ~/.zen/tmp/${MOATS}
|
|||||||
## 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/__/_*_*/_*.?_*.?/_*.??_*.??
|
## SEARCH UMAP (created by PLAYER.refresh.sh) /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
|
||||||
MEMAPS=($(ls -t ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/ 2>/dev/null))
|
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/__/_*_*/_*.?_*.?/* | rev | cut -d '/' -f 1 | rev | sort | uniq 2>/dev/null) )
|
SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
|
||||||
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
|
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
|
||||||
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
|
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
|
||||||
echo "ACTIVATED UMAPS : ${unique_combined[@]}" # "_LAT_LON" directories
|
echo "ACTIVATED UMAPS : ${unique_combined[@]}" # "_LAT_LON" directories
|
||||||
@ -62,23 +67,23 @@ mkdir ~/.zen/tmp/${MOATS}
|
|||||||
echo "ORIGIN : ${myIPFS}/ipns/${UMAPNS}"
|
echo "ORIGIN : ${myIPFS}/ipns/${UMAPNS}"
|
||||||
|
|
||||||
###################### SPATIO TEMPORAL KEYS
|
###################### 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}"
|
|
||||||
|
|
||||||
## TODATE #########################################
|
## TODATE #########################################
|
||||||
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
|
${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
|
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
|
||||||
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
|
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
|
||||||
echo "TODAY : ${myIPFS}/ipns/${TODATENS}"
|
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
|
echo "## IPFS GET YESTERDATENS"
|
||||||
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
|
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
|
||||||
ipfs --timeout 180s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
|
ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
|
|
||||||
@ -86,7 +91,8 @@ mkdir ~/.zen/tmp/${MOATS}
|
|||||||
[[ ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN || ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} ]] \
|
[[ ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN || ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} ]] \
|
||||||
&& echo ">>> INFO - INTIALIZE UMAP FORMAT - NEW UMAP KEY -" \
|
&& echo ">>> INFO - INTIALIZE UMAP FORMAT - NEW UMAP KEY -" \
|
||||||
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} \
|
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} \
|
||||||
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN
|
&& 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}/RSS
|
||||||
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW
|
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW
|
||||||
@ -94,35 +100,11 @@ mkdir ~/.zen/tmp/${MOATS}
|
|||||||
echo "~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/"
|
echo "~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/"
|
||||||
|
|
||||||
## zday of the week for IPFSNODEID
|
## zday of the week for IPFSNODEID
|
||||||
rm ~/.zen/tmp/${MOATS}/${UMAP}/z* ## TODO RESTRICT T O z*.html
|
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)
|
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain 2>/dev/null | 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
|
[[ "${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 "
|
|
||||||
|
|
||||||
# IF LESS THAN 5 HOURS
|
|
||||||
if [ ${DIFF_SECONDS} -lt $(( 5 * 60 * 60 )) ]; then
|
|
||||||
echo "GETTING YESTERDAY UMAP.refresher"
|
|
||||||
YESTERDAY=$(ipfs cat /ipfs/${ZCHAIN}/${LAT}_${LON}/UMAP.refresher | head -n 1)
|
|
||||||
## GET UMAP.refresher from PREVIOUS _chain ...
|
|
||||||
TODAY=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/UMAP.refresher | head -n 1)
|
|
||||||
echo "TODAY : ${TODAY}"
|
|
||||||
echo "YESTERDAY : ${YESTERDAY}"
|
|
||||||
echo "------------------------------------------------->>>>>>>>>>>>>>>>"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
########################################################
|
########################################################
|
||||||
## NODE SELECTION in UMAP.refresher
|
## NODE SELECTION in UMAP.refresher
|
||||||
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/UMAP.refresher"
|
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/UMAP.refresher"
|
||||||
@ -141,16 +123,28 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
|
|||||||
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
|
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
|
||||||
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
|
[[ ! $(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
|
## IF NOT UPDATED FOR TOO LONG
|
||||||
[ ${DIFF_SECONDS} -gt 100800 ] \
|
[[ ${DIFF_SECONDS} -gt $(( 26 * 60 * 60 )) || ${DIFF_SECONDS} -eq 0 ]] \
|
||||||
&& echo "More than 28H update" \
|
&& echo "More than 26H update - BOOSTRAP 0 ACTION -" \
|
||||||
&& ACTINGNODE=${STRAPS[0]}
|
&& ACTINGNODE=${STRAPS[0]}
|
||||||
|
|
||||||
echo "* ACTINGNODE=${ACTINGNODE}"
|
echo "* ACTINGNODE=${ACTINGNODE}"
|
||||||
|
|
||||||
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
|
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
|
||||||
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
|
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
|
||||||
&& continue
|
&& ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}"; continue
|
||||||
########################################
|
########################################
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PASSING THERE MAKE IPFSNODEID UMAP REFRESHER
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PASSING THERE MAKE IPFSNODEID UMAP REFRESHER
|
||||||
|
|
||||||
@ -180,7 +174,7 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
|
|||||||
COINS=$($MY_PATH/../tools/COINScheck.sh ${SECTORG1PUB} | tail -n 1)
|
COINS=$($MY_PATH/../tools/COINScheck.sh ${SECTORG1PUB} | tail -n 1)
|
||||||
echo "SECTOR : ${SECTOR} (${COINS} G1) WALLET : ${SECTORG1PUB}"
|
echo "SECTOR : ${SECTOR} (${COINS} G1) WALLET : ${SECTORG1PUB}"
|
||||||
|
|
||||||
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${SECTOR}.priv "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
|
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${SECTOR}.priv "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
|
||||||
ipfs key rm ${SECTORG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
|
ipfs key rm ${SECTORG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
|
||||||
SECTORNS=$(ipfs key import ${SECTORG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${SECTOR}.priv)
|
SECTORNS=$(ipfs key import ${SECTORG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${SECTOR}.priv)
|
||||||
ipfs key rm ${SECTORG1PUB}
|
ipfs key rm ${SECTORG1PUB}
|
||||||
@ -201,13 +195,13 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
|
|||||||
COINS=$($MY_PATH/../tools/COINScheck.sh ${REGIONG1PUB} | tail -n 1)
|
COINS=$($MY_PATH/../tools/COINScheck.sh ${REGIONG1PUB} | tail -n 1)
|
||||||
echo "REGION : ${REGION} (${COINS} G1) WALLET : ${REGIONG1PUB}"
|
echo "REGION : ${REGION} (${COINS} G1) WALLET : ${REGIONG1PUB}"
|
||||||
|
|
||||||
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/REGION.priv "${UPLANETNAME}${REGION}" "${UPLANETNAME}${REGION}"
|
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/REGION.priv "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}"
|
||||||
ipfs key rm ${REGIONG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
|
ipfs key rm ${REGIONG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
|
||||||
REGIONNS=$(ipfs key import ${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
|
TODATEREGIONNS=$(ipfs key import ${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
|
||||||
ipfs key rm ${REGIONG1PUB}
|
ipfs key rm ${REGIONG1PUB}
|
||||||
##############################################################
|
##############################################################
|
||||||
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}
|
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}
|
||||||
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${REGIONNS}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}/index.html
|
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/__/_*_*/_*.?_*.?/_*.??_*.??
|
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
|
||||||
@ -232,8 +226,8 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
|
|||||||
##################################
|
##################################
|
||||||
## OSM2IPFS
|
## OSM2IPFS
|
||||||
### UMAP = 0.01° Planet Slice
|
### UMAP = 0.01° Planet Slice
|
||||||
UMAPGEN="${EARTHCID}/Umap.html?southWestLat=${LAT}&southWestLon=${LON}°=0.01&ipns=${UMAPNS}/_index.html"
|
UMAPGEN="${EARTHCID}/Umap.html?southWestLat=${LAT}&southWestLon=${LON}°=0.01&ipns=${TODATENS}/_index.html"
|
||||||
USATGEN="${EARTHCID}/Usat.html?southWestLat=${LAT}&southWestLon=${LON}°=0.01&ipns=${UMAPNS}/_index.html"
|
USATGEN="${EARTHCID}/Usat.html?southWestLat=${LAT}&southWestLon=${LON}°=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='${UMAPGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Umap.html
|
||||||
echo "<meta http-equiv=\"refresh\" content=\"0; url='${USATGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Usat.html
|
echo "<meta http-equiv=\"refresh\" content=\"0; url='${USATGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Usat.html
|
||||||
|
|
||||||
@ -344,15 +338,17 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
|
|||||||
SECLAT="${LAT::-1}"
|
SECLAT="${LAT::-1}"
|
||||||
SECLON="${LON::-1}"
|
SECLON="${LON::-1}"
|
||||||
SECTOR="_${SECLAT}_${SECLON}"
|
SECTOR="_${SECLAT}_${SECLON}"
|
||||||
SECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}")
|
TODATESECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}")
|
||||||
|
|
||||||
PHONEBOOTH="${G1PUB::30}"
|
PHONEBOOTH="${G1PUB::30}"
|
||||||
cat ${MY_PATH}/../templates/UPlanetUmap/index.html \
|
cat ${MY_PATH}/../templates/UPlanetUmap/index.html \
|
||||||
| sed -e "s~_ZONE_~UMAP ${UMAP}~g" \
|
| sed -e "s~_ZONE_~UMAP ${UMAP}~g" \
|
||||||
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
|
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
|
||||||
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
|
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
|
||||||
-e "s~_ZONENS_~${UMAPNS}~g" \
|
-e "s~_ZONENS_~${TODATENS}~g" \
|
||||||
-e "s~_UPZONENS_~${SECTORNS}~g" \
|
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
|
||||||
|
-e "s~_HACKGIPFS_~${HACKGIPFS}~g" \
|
||||||
|
-e "s~_UPZONENS_~${TODATESECTORNS}~g" \
|
||||||
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
|
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
|
||||||
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
|
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
|
||||||
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${LAT}\&southWestLon=${LON}\°=0.01~g" \
|
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${LAT}\&southWestLon=${LON}\°=0.01~g" \
|
||||||
@ -390,10 +386,10 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/
|
|||||||
|
|
||||||
ipfs name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
|
ipfs name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
ipfs key rm ${TODATE}${G1PUB} ${YESYERDATE}${G1PUB} ${G1PUB} ## REMOVE IPNS KEY
|
|
||||||
|
|
||||||
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
|
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
|
||||||
|
|
||||||
|
ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}" ## REMOVE IPNS KEY
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ LIBRA=$(head -n 2 ${MY_PATH}/../A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f
|
|||||||
################################################################################
|
################################################################################
|
||||||
TWMODEL="/ipfs/bafybeie6sx76balvpeehvbh5du7oc5fhjuwydryympeh3qnm5s3b2jrvwe"
|
TWMODEL="/ipfs/bafybeie6sx76balvpeehvbh5du7oc5fhjuwydryympeh3qnm5s3b2jrvwe"
|
||||||
# ipfs cat $TWMODEL > templates/twdefault.html
|
# ipfs cat $TWMODEL > templates/twdefault.html
|
||||||
MINIMAL="/ipfs/bafybeicpfrsx44lkib4352eulvohmgdpaww3sau3qtbj7fzj6qw7xsokhy"
|
MINIMAL="/ipfs/bafybeifnlpnvpxxnblgwefoflmdnt2vhckmnu22orsi43zilh2v4sbegjy"
|
||||||
# ipfs cat $MINIMAL > templates/twuplanet.html
|
# ipfs cat $MINIMAL > templates/twuplanet.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
@ -312,6 +312,11 @@ DISCO="/?salt=${USALT}&pepper=${UPEPPER}"
|
|||||||
## Change myIP
|
## Change myIP
|
||||||
#~ sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or ipfs.localhost)
|
#~ sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or ipfs.localhost)
|
||||||
|
|
||||||
|
## TODATE #########################################
|
||||||
|
TODATESECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}")
|
||||||
|
DEMAINSECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${DEMAINDATE}${UPLANETNAME}${SECTOR}" "${DEMAINDATE}${UPLANETNAME}${SECTOR}")
|
||||||
|
|
||||||
|
|
||||||
###########
|
###########
|
||||||
## GET OLD16
|
## GET OLD16
|
||||||
tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'MIZ.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
|
tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'MIZ.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
|
||||||
@ -515,72 +520,98 @@ LP=$(ls /dev/usb/lp* 2>/dev/null)
|
|||||||
## NO. GCHANGE+ IS THE MAIN INTERFACE, astrXbian manage
|
## NO. GCHANGE+ IS THE MAIN INTERFACE, astrXbian manage
|
||||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||||
echo "$(${MY_PATH}/../tools/face.sh cool)"
|
echo "$(${MY_PATH}/../tools/face.sh cool)"
|
||||||
echo " 'Astronaute' $PSEUDO"
|
echo " 'Astronaut' $PSEUDO"
|
||||||
echo
|
echo
|
||||||
echo "* ZenCard : Public Key and Wallet
|
echo "* ZenCard : Public Key and Wallet
|
||||||
${NID}/ipns/${ASTRONAUTENS}#ZenCard"
|
${NID}/ipns/${ASTRONAUTENS}#ZenCard"
|
||||||
echo " "
|
echo " "
|
||||||
echo "* AstroID : AstroID with PASS : $PASS"
|
echo "* AstroID : with PASS : $PASS"
|
||||||
echo "${NID}/ipns/${ASTRONAUTENS}#AstroID"
|
echo "${NID}/ipns/${ASTRONAUTENS}#AstroID"
|
||||||
echo
|
echo
|
||||||
echo "* UMap : registration at ${LAT}, ${LON}
|
echo "* UMap : registration at ${LAT}, ${LON}
|
||||||
${myIPFS}${URL}"
|
${myIPFS}${URL}"
|
||||||
echo
|
echo
|
||||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||||
#~ echo "BIENVENUE"
|
|
||||||
#~ echo "https://monnaie-libre.fr (ğ1) : $G1PUB"; # sleep 1
|
|
||||||
#~ echo "
|
|
||||||
#~ Vos Secrets :
|
|
||||||
#~ $SALT
|
|
||||||
#~ $PEPPER
|
|
||||||
|
|
||||||
#~ * WALLET : https://cesium.app
|
|
||||||
#~ * MARKET : https://gchange.fr
|
|
||||||
|
|
||||||
#~ U Planet : ${myUPLANET}
|
|
||||||
#~ Astroport.ONE ★ PKI ★ Ğ1/Ŋ1 ★ DAO ★ Libre ★"; # sleep 1
|
|
||||||
#~ echo "$(${MY_PATH}/../tools/face.sh friendly) ★ GCHANGE LIBRE MARKET ★"
|
|
||||||
#~ echo "Use $SALT and $PEPPER to register on https://cesium.app and https://gchange.fr to ★ friends"
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo $PSEUDO > ~/.zen/tmp/PSEUDO ## Return data to command.sh # KEEP IT
|
#####################################################################"
|
||||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
#####################################################################"
|
||||||
echo "export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$PLAYER ASTROFEED=$FEEDNS PASS=$PASS"
|
#####################################################################"
|
||||||
|
|
||||||
### SEND AstroID and ZenCard to EMAIL
|
### SEND AstroID and ZenCard to EMAIL
|
||||||
(
|
(
|
||||||
echo "<html><body><h1>UPlanet : ZenCard</h1>
|
echo "<html><head>
|
||||||
This is your ZenCard : your public key (your flag)" > ~/.zen/tmp/${MOATS}/ZenCard.txt
|
<style>
|
||||||
echo "<br><a href='${myIPFSGW}${IASTRO}'>ZenCard</a><br><img src='${myIPFSGW}${IASTRO}'\>
|
body {
|
||||||
<br>it contains you Ẑen and TW address
|
font-family: 'Courier New', monospace;
|
||||||
<br></body></html>" >> ~/.zen/tmp/${MOATS}/ZenCard.txt
|
}
|
||||||
|
pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
</style></head>
|
||||||
|
<body>
|
||||||
|
<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
|
||||||
|
echo "$line" | sed "s~ ~\ ~g" >> ~/.zen/tmp/${MOATS}/ZenCard.html
|
||||||
|
echo "<br>" >> ~/.zen/tmp/${MOATS}/ZenCard.html
|
||||||
|
done <"$asciiart"
|
||||||
|
|
||||||
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/ZenCard.txt "ZenCard"
|
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}) "
|
||||||
|
|
||||||
#~ mpack -a -s "✅ UPlanet : ZenCard" -d ~/.zen/tmp/${MOATS}/intro.txt \
|
#~ mpack -a -s "✅ UPlanet : ZenCard" -d ~/.zen/tmp/${MOATS}/intro.txt \
|
||||||
#~ ~/.zen/tmp/${MOATS}/pseudo.png ${PLAYER}
|
#~ ~/.zen/tmp/${MOATS}/pseudo.png ${PLAYER}
|
||||||
|
|
||||||
echo "<html><body>
|
#####################################################################"
|
||||||
<h1>UPlanet : AstroID ($PASS)</h1>
|
#####################################################################"
|
||||||
This is your AstroID : your private key (your ring)" > ~/.zen/tmp/${MOATS}/AstroID.txt
|
#####################################################################"
|
||||||
echo "
|
|
||||||
<br>You own one of the 'Rings of the Lords' on <a href='https://qo-op.com'>Uplanet</a> 0.1° SECTOR : ${SECTOR}
|
|
||||||
<br>it is forged from SECRET1=$SALT SECRET2=$PEPPER then secured by PIN : $PASS
|
|
||||||
<br>
|
|
||||||
<br>Your ASTROPORT STATION is <a href='${myAPI}'>NODE#${IPFSNODEID}</a>
|
|
||||||
" >> ~/.zen/tmp/${MOATS}/AstroID.txt
|
|
||||||
echo "<br><a href='${myIPFS}/ipns/${ASTROTW}#AstroID'>AstroID</a><br><img src='${myIPFSGW}${ASTROQR}'\>
|
|
||||||
<br>
|
|
||||||
<br>Print it and delete from TW to keep it secure.
|
|
||||||
</body></html>" >> ~/.zen/tmp/${MOATS}/AstroID.txt
|
|
||||||
|
|
||||||
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/AstroID.txt "AstroID"
|
echo "<html><head>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'Courier New', monospace;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
</style></head>
|
||||||
|
<body>
|
||||||
|
<h1>UPlanet : AstroID ($PASS)</h1>" > ~/.zen/tmp/${MOATS}/AstroID.html
|
||||||
|
asciiart="${MY_PATH}/../images/logoastro.art"
|
||||||
|
while IFS= read -r line
|
||||||
|
do
|
||||||
|
echo "$line" | sed "s~ ~\ ~g" >> ~/.zen/tmp/${MOATS}/AstroID.html
|
||||||
|
echo "<br>" >> ~/.zen/tmp/${MOATS}/AstroID.html
|
||||||
|
done <"$asciiart"
|
||||||
|
|
||||||
|
echo "
|
||||||
|
<h3> <--> 0.1 SECTOR : <a href='${EARTHCID}/map_render.html?southWestLat=${LAT::-1}&southWestLon=${LON::-1}°=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='${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}) "
|
||||||
|
|
||||||
#~ mpack -a -s "✅ UPlanet : AstroID ($PASS)" -d ~/.zen/tmp/${MOATS}/intro.txt \
|
#~ mpack -a -s "✅ UPlanet : AstroID ($PASS)" -d ~/.zen/tmp/${MOATS}/intro.txt \
|
||||||
#~ $HOME/.zen/game/players/${PLAYER}/AstroID.png ${PLAYER}
|
#~ $HOME/.zen/game/players/${PLAYER}/AstroID.png ${PLAYER}
|
||||||
|
|
||||||
|
#####################################################################"
|
||||||
|
#####################################################################"
|
||||||
|
#####################################################################"
|
||||||
|
|
||||||
## CLEANING CACHE
|
## CLEANING CACHE
|
||||||
rm -Rf ~/.zen/tmp/${MOATS}
|
rm -Rf ~/.zen/tmp/${MOATS}
|
||||||
) &
|
) &
|
||||||
|
|
||||||
|
echo $PSEUDO > ~/.zen/tmp/PSEUDO ## Return data to command.sh # KEEP IT
|
||||||
|
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||||
|
################################################ LAST LINE REPORT VALUES TO CALLING SCRIPT | tail -n 1
|
||||||
|
echo "export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$PLAYER ASTROFEED=$FEEDNS PASS=$PASS"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -15,6 +15,8 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|||||||
# ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/*
|
# ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/*
|
||||||
# _PLAYER.json
|
# _PLAYER.json
|
||||||
|
|
||||||
|
# change SWARM memory
|
||||||
|
### # ~/.zen/tmp/${IPFSNODEID}/WISH/${WISHNAME}/${PLAYER}/*
|
||||||
|
|
||||||
PLAYER="$1" ## IPNS KEY NAME - G1PUB - PLAYER ...
|
PLAYER="$1" ## IPNS KEY NAME - G1PUB - PLAYER ...
|
||||||
[[ ! ${PLAYER} ]] && echo "Please provide PLAYER publish key" && exit 1
|
[[ ! ${PLAYER} ]] && echo "Please provide PLAYER publish key" && exit 1
|
||||||
@ -37,9 +39,6 @@ INDEX="$3"
|
|||||||
|
|
||||||
mkdir -p ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu
|
mkdir -p ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu
|
||||||
|
|
||||||
## PROTOCOL EVOLUTION RUN & REMOVE
|
|
||||||
rm -Rf ~/.zen/tmp/${IPFSNODEID}/${PLAYER}
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
####### NEED G1 / ZEN TO RUN
|
####### NEED G1 / ZEN TO RUN
|
||||||
[[ ${COINS} == "null" || ${COINS} == "" ]] \
|
[[ ${COINS} == "null" || ${COINS} == "" ]] \
|
||||||
@ -165,7 +164,27 @@ do
|
|||||||
&& rm ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json \
|
&& rm ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json \
|
||||||
&& continue
|
&& continue
|
||||||
|
|
||||||
|
#####################################################
|
||||||
echo "## TIDDLERS FOUND ;) MIAM >>> (◕‿‿◕) <<<"
|
echo "## TIDDLERS FOUND ;) MIAM >>> (◕‿‿◕) <<<"
|
||||||
|
##############################
|
||||||
|
## WRITE FRIEND SAME WISH TIDDLERS IN PLAYER TW ########
|
||||||
|
##############################
|
||||||
|
## SIGN Tiddlers
|
||||||
|
cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json \
|
||||||
|
| sed "s~${PLAYER}~~g" \
|
||||||
|
| sed "s~${APLAYER}~${APLAYER} ${PLAYER}~g" \
|
||||||
|
> ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.signed.json
|
||||||
|
|
||||||
|
## ADD TO TW
|
||||||
|
tiddlywiki --load ${INDEX} \
|
||||||
|
--import ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.signed.json "application/json" \
|
||||||
|
--output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "newindex.html" "text/plain"
|
||||||
|
## CHECK IT IS OK
|
||||||
|
[[ -s ~/.zen/tmp/${MOATS}/newindex.html ]] \
|
||||||
|
&& cp ~/.zen/tmp/${MOATS}/newindex.html ${INDEX} \
|
||||||
|
&& rm ~/.zen/tmp/${MOATS}/newindex.html
|
||||||
|
|
||||||
|
##############################
|
||||||
echo ">>> G1FRIEND § $myIPFS${IPNS_VOEUNS}/_${APLAYER}.tiddlers.rss.json ${WISHNAME}"
|
echo ">>> G1FRIEND § $myIPFS${IPNS_VOEUNS}/_${APLAYER}.tiddlers.rss.json ${WISHNAME}"
|
||||||
|
|
||||||
# Extract Origin G1Voeu Tiddler
|
# Extract Origin G1Voeu Tiddler
|
||||||
@ -275,11 +294,12 @@ if [[ ${wishnumbers} -gt 0 ]]; then
|
|||||||
--output ~/.zen/tmp/${MOATS} \
|
--output ~/.zen/tmp/${MOATS} \
|
||||||
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
|
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
|
||||||
TWMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
|
TWMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
|
||||||
|
[[ $TWMAPNS == "null" || $TWMAPNS == "" ]] && TWMAPNS="/ipns/k51qzi5uqu5djg1gqzujq5p60w25mi235gdg0lgkk5qztkfrpi5c22oolrriyu"
|
||||||
LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
|
LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
|
||||||
[[ ${LAT} == "null" ]] && LAT="0.00"
|
[[ ${LAT} == "null" || ${LAT} == "" ]] && LAT="0.00"
|
||||||
LAT=$(makecoord $LAT)
|
LAT=$(makecoord $LAT)
|
||||||
LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
|
LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
|
||||||
[[ ${LON} == "null" ]] && LON="0.00"
|
[[ ${LON} == "null" || ${LON} == "" ]] && LON="0.00"
|
||||||
LON=$(makecoord $LON)
|
LON=$(makecoord $LON)
|
||||||
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${TWMAPNS}"
|
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${TWMAPNS}"
|
||||||
rm ~/.zen/tmp/${MOATS}/GPS.json
|
rm ~/.zen/tmp/${MOATS}/GPS.json
|
||||||
@ -296,7 +316,7 @@ if [[ ${wishnumbers} -gt 0 ]]; then
|
|||||||
to ${SECTOR} WALLET ${SECTORG1PUB}"
|
to ${SECTOR} WALLET ${SECTORG1PUB}"
|
||||||
echo "************************************************************"
|
echo "************************************************************"
|
||||||
MYWISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/* | tail -n 1) # ADDING JSONS TO IPFS
|
MYWISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/* | tail -n 1) # ADDING JSONS TO IPFS
|
||||||
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${G1AMOUNT}" "${SECTORG1PUB}" "ipfs://${MYWISHFLUX}"
|
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${G1AMOUNT}" "${SECTORG1PUB}" "/ipfs/${MYWISHFLUX}"
|
||||||
fi
|
fi
|
||||||
################################################
|
################################################
|
||||||
################################################ GRATITUDE SENT TO SECTOR
|
################################################ GRATITUDE SENT TO SECTOR
|
||||||
|
58
UPlanetKEYS_refresh.sh
Executable file
@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
########################################################################
|
||||||
|
# Version: 0.1
|
||||||
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
|
########################################################################
|
||||||
|
## EXPLORE SWARM MAPNS
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
ME="${0##*/}"
|
||||||
|
|
||||||
|
. "$MY_PATH/tools/my.sh"
|
||||||
|
## LOG into ~/.zen/tmp/_12345.log
|
||||||
|
exec 2>&1 >> ~/.zen/tmp/_12345.log
|
||||||
|
|
||||||
|
echo "(◕‿◕ ) ${ME} (◕‿◕ ) "
|
||||||
|
|
||||||
|
## LOCAL
|
||||||
|
LWKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
|
||||||
|
echo ${#LWKEYS[@]} " local UMAPS"
|
||||||
|
LSKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_*_*/_*.?_*.?/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
|
||||||
|
echo ${#LSKEYS[@]} " local SECTORS"
|
||||||
|
LRKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_*_*/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
|
||||||
|
echo ${#LRKEYS[@]} " local REGIONS"
|
||||||
|
|
||||||
|
## SWARM
|
||||||
|
WKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
|
||||||
|
echo ${#WKEYS[@]} " swarm UMAPS"
|
||||||
|
SKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/SECTORS/_*_*/_*.?_*.?/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
|
||||||
|
echo ${#SKEYS[@]} " swarm SECTORS"
|
||||||
|
RKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/REGIONS/_*_*/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
|
||||||
|
echo ${#RKEYS[@]} " swarm REGIONS"
|
||||||
|
|
||||||
|
## CHECK FOR ANY ALREADY MErunning
|
||||||
|
MErunning=$(ps axf --sort=+utime | grep -w ${ME} | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||||
|
[[ $MErunning ]] && echo "${ME} MErunning for too long..." && kill -9 $MErunning
|
||||||
|
|
||||||
|
echo "(◕‿◕ ) ${ME} starting UPlanet Terraformation _______________________________"
|
||||||
|
|
||||||
|
combined=("${LWKEYS[@]}" "${LSKEYS[@]}" "${LRKEYS[@]}" "${WKEYS[@]}" "${SKEYS[@]}" "${RKEYS[@]}")
|
||||||
|
UKEYS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
|
||||||
|
echo ${#UKEYS[@]} " JOBS..."
|
||||||
|
|
||||||
|
## STORAGE FOR IPFS GET on UPLANET KEYS
|
||||||
|
mkdir -p ~/.zen/tmp/flashmem
|
||||||
|
|
||||||
|
floop=0
|
||||||
|
medo=0
|
||||||
|
|
||||||
|
for key in ${UKEYS[@]}; do
|
||||||
|
rm -Rf ~/.zen/tmp/flashmem
|
||||||
|
echo "ipfs --timeout 30s get -o ~/.zen/tmp/flashmem /ipns/$key"
|
||||||
|
ipfs --timeout 30s get -o ~/.zen/tmp/flashmem /ipns/$key
|
||||||
|
[[ $? == 0 ]] && medo=$((medo +1))
|
||||||
|
floop=$((floop +1))
|
||||||
|
[ $floop -gt 100 ] && break
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "(◕‿◕ ) ${ME} :: $medo SUCCESS over $floop KEYS from ${#UKEYS[@]} JOBS"
|
3
WWW/FAVICON/Readme.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Images & icons
|
||||||
|
|
||||||
|
Add favicon from the web2.0 you wish to copy to WEB3
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
BIN
WWW/FAVICON/favicon.carte.monnaie-libre.png
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
BIN
WWW/FAVICON/favicon.groceliande.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
BIN
WWW/FAVICON/favicon.naturaltime.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 628 B |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 870 B |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 822 B After Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
13
WWW/Readme.md
Normal 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
|
61
YNOV.md
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# SCRIPT01/BLOCKCHAIN01
|
||||||
|
|
||||||
|
## ssh
|
||||||
|
|
||||||
|
https://pad.p2p.legal/keygen
|
||||||
|
|
||||||
|
## git
|
||||||
|
|
||||||
|
```
|
||||||
|
git add .
|
||||||
|
git commit -m "mon commentaire"
|
||||||
|
git push
|
||||||
|
```
|
||||||
|
|
||||||
|
## $() function
|
||||||
|
|
||||||
|
```
|
||||||
|
. ${MY_PATH}/my.sh
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Absolute ${MY_PATH}
|
||||||
|
|
||||||
|
```
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
ME="${0##*/}"
|
||||||
|
```
|
||||||
|
|
||||||
|
## ${} variable
|
||||||
|
|
||||||
|
```
|
||||||
|
VAR="value or list of terms"
|
||||||
|
TAB=("value or list of terms")
|
||||||
|
|
||||||
|
echo ${VAR}
|
||||||
|
echo ${TAB}
|
||||||
|
echo ${TAB[@]}
|
||||||
|
|
||||||
|
# for, while, select, ... done (< read source)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## bug des leviers
|
||||||
|
|
||||||
|
```
|
||||||
|
sed -i='' 's/off/on/' ../logic/stationlogic.ben
|
||||||
|
```
|
||||||
|
|
||||||
|
## WSL problème décodage
|
||||||
|
|
||||||
|
```
|
||||||
|
dos2unix
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# FORMATION WEB3 : https://chaton.g1sms.fr
|
||||||
|
|
||||||
|
Ajoutez une "Zen Station" à votre Région.
|
||||||
|
|
||||||
|
* Installez Astroport.ONE et suivez la procédure : https://pad.p2p.legal/keygen pour relier votre clef SSH à IPFS et rejoindre la toile de confiance des Dragons, hébergeurs collectifs "LeClaude"
|
@ -81,9 +81,13 @@ while true; do
|
|||||||
## FIXING TIC TAC FOR NODE & SWARM REFRESH ( 1H )
|
## FIXING TIC TAC FOR NODE & SWARM REFRESH ( 1H )
|
||||||
if [[ ${duree} -gt 3600000 ]]; then
|
if [[ ${duree} -gt 3600000 ]]; then
|
||||||
|
|
||||||
|
${MY_PATH}/ping_bootstrap.sh
|
||||||
|
|
||||||
|
#### UPLANET FLASHMEM UPDATES
|
||||||
|
${MY_PATH}/UPlanetKEYS_refresh.sh &
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
( ##### SUB-PROCESS RUN
|
( ##### SUB-PROCESS £
|
||||||
exec 2>&1 >> ~/.zen/tmp/_12345.log
|
|
||||||
start=`date +%s`
|
start=`date +%s`
|
||||||
|
|
||||||
# MONITOR pending
|
# MONITOR pending
|
||||||
@ -102,6 +106,7 @@ while true; do
|
|||||||
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | grep -v '^[[:space:]]*$') # remove comments and empty lines
|
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | grep -v '^[[:space:]]*$') # remove comments and empty lines
|
||||||
do
|
do
|
||||||
|
|
||||||
|
## ex: /ip4/149.102.158.67/tcp/4001/p2p/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u)
|
||||||
echo "############# RUN LOOP ######### $(date)"
|
echo "############# RUN LOOP ######### $(date)"
|
||||||
ipfsnodeid=${bootnode##*/}
|
ipfsnodeid=${bootnode##*/}
|
||||||
|
|
||||||
|
@ -16,34 +16,78 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|||||||
ME="${0##*/}"
|
ME="${0##*/}"
|
||||||
###################################################################
|
###################################################################
|
||||||
### CREER VOTRE PROPRE VERSION DU JEU
|
### CREER VOTRE PROPRE VERSION DU JEU
|
||||||
### CHOISIR SCENARIO
|
### List games/E@MAIL/ directories
|
||||||
|
## 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 !
|
||||||
|
|
||||||
###################################################################
|
# BASH is CREOLE
|
||||||
if hash uuidgen 2>/dev/null; then
|
# this cd *@* METHOD resist to " " space
|
||||||
|
cd ${MY_PATH}/games \
|
||||||
|
&& GAMES=(".." *@*) && cd .. \
|
||||||
|
|| GAMES=".."
|
||||||
|
## but can still be fooled by file...
|
||||||
|
|
||||||
|
## personalisez le prompt
|
||||||
|
PS3="CHOIX DU GAME : __ "
|
||||||
|
|
||||||
|
select game in "${GAMES[@]}"; do
|
||||||
|
|
||||||
|
# MY_GAME is the absolute path to selected game files
|
||||||
|
MY_GAME="$MY_PATH/games/$game"
|
||||||
|
echo "SELECTION: "${MY_GAME}
|
||||||
|
|
||||||
|
diff --recursive --brief ${MY_GAME}/ ${MY_GAME}/../_votre\ jeu/
|
||||||
|
|
||||||
|
echo "confirm ?"
|
||||||
|
read ENTER
|
||||||
|
|
||||||
|
if [[ ! $ENTER ]]; then
|
||||||
|
# test game start protocol compatibility
|
||||||
|
if [[ -x ${MY_GAME}/rooms/start.sh ]]; then
|
||||||
|
sleep 1
|
||||||
|
echo "Charging game..."
|
||||||
|
sleep 1
|
||||||
|
break
|
||||||
|
else
|
||||||
|
# not compatible
|
||||||
|
echo "ERROR - not compatible game - SELECT ANOTHER - "
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "CHOOSE NEXT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# copy game files to user specific executable space
|
||||||
|
# $HOME/.zen/adventure/$newplayer
|
||||||
|
########################################
|
||||||
homefolder=$(pwd)
|
homefolder=$(pwd)
|
||||||
newplayer=$(uuidgen)
|
newplayer=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 10)
|
||||||
## Copy Player Game Files
|
## Copy Player Game Files
|
||||||
mkdir -p $HOME/.zen/adventure/$newplayer
|
mkdir -p $HOME/.zen/adventure/$newplayer
|
||||||
cp -r $MY_PATH/rooms $HOME/.zen/adventure/$newplayer/rooms
|
cp -r ${MY_GAME}/rooms $HOME/.zen/adventure/$newplayer/rooms
|
||||||
cp -r $MY_PATH/art $HOME/.zen/adventure/$newplayer/art
|
cp -r ${MY_GAME}/art $HOME/.zen/adventure/$newplayer/art
|
||||||
cp -r $MY_PATH/script $HOME/.zen/adventure/$newplayer/script
|
cp -r ${MY_GAME}/script $HOME/.zen/adventure/$newplayer/script
|
||||||
cp -r $MY_PATH/logic $HOME/.zen/adventure/$newplayer/logic
|
cp -r ${MY_GAME}/logic $HOME/.zen/adventure/$newplayer/logic
|
||||||
fi
|
|
||||||
|
|
||||||
###################################################################
|
###################################################################
|
||||||
echo "Loading..."
|
echo "Loading... $newplayer/rooms/start.sh"
|
||||||
echo
|
echo
|
||||||
sleep 4
|
sleep 2
|
||||||
###################################################################
|
###################################################################
|
||||||
if hash uuidgen 2>/dev/null; then
|
|
||||||
cd $HOME/.zen/adventure/$newplayer/rooms
|
cd $HOME/.zen/adventure/$newplayer/rooms
|
||||||
else
|
|
||||||
cd rooms
|
|
||||||
fi
|
|
||||||
./start.sh
|
./start.sh
|
||||||
|
|
||||||
###################################################################
|
###################################################################
|
||||||
if hash uuidgen 2>/dev/null; then
|
# cleaning game files
|
||||||
cd "$homefolder"
|
cd "$homefolder"
|
||||||
rm -r $HOME/.zen/adventure/$newplayer
|
rm -r $HOME/.zen/adventure/$newplayer
|
||||||
fi
|
|
||||||
echo "To continue..."
|
echo "To continue..."
|
||||||
exit
|
exit
|
||||||
|
24
adventure/adventuremulti.EA.sh
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Chemin vers le répertoire des jeux
|
||||||
|
games_dir="./games"
|
||||||
|
|
||||||
|
# Afficher les jeux disponibles
|
||||||
|
echo "Jeux disponibles :"
|
||||||
|
games=$(ls "$games_dir")
|
||||||
|
|
||||||
|
# Afficher les jeux dans un menu numéroté
|
||||||
|
select game in $games; do
|
||||||
|
if [ ! -z "$game" ]; then
|
||||||
|
echo "Vous avez choisi $game."
|
||||||
|
cd "$games_dir" || exit 1
|
||||||
|
# Assurez-vous que start.sh est exécutable
|
||||||
|
chmod +x "$game/start.sh"
|
||||||
|
# Exécuter start.sh du jeu sélectionné
|
||||||
|
cd ./$game/rooms
|
||||||
|
./start.sh
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "Choix invalide. Veuillez choisir un numéro de jeu valide."
|
||||||
|
fi
|
||||||
|
done
|
34
adventure/adventuremulti.TV.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
GAMES_DIR="./games"
|
||||||
|
|
||||||
|
if [ ! -d "$GAMES_DIR" ]; then
|
||||||
|
echo "Le dossier des jeux $GAMES_DIR n'existe pas."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
GAMES=$(find "$GAMES_DIR" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
||||||
|
|
||||||
|
if [ -z "$GAMES" ]; then
|
||||||
|
echo "Aucun jeu trouvé dans le dossier $GAMES_DIR."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Sélectionnez un jeu :"
|
||||||
|
select GAME in $GAMES; do
|
||||||
|
if [ -n "$GAME" ]; then
|
||||||
|
cd "$GAMES_DIR/$GAME/rooms"
|
||||||
|
START_SCRIPT="./start.sh"
|
||||||
|
|
||||||
|
if [ ! -x "$START_SCRIPT" ]; then
|
||||||
|
echo "Le fichier start.sh pour $GAME n'existe pas ou n'est pas exécutable."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Lancement de $GAME..."
|
||||||
|
"$START_SCRIPT"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "Choix invalide. Veuillez réessayer."
|
||||||
|
fi
|
||||||
|
done
|
49
adventure/games/_votre jeu/adventure.sh
Executable 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
|
21
adventure/games/_votre jeu/art/Gune.ben
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
.';:llllc;'.
|
||||||
|
.:xXWX;.,ll;.:XWXx;.
|
||||||
|
;0MMMMMMKl;'',l0MMMMMWO,
|
||||||
|
,0MMMMMMW0dc;,,;cd0WMMMMMMO.
|
||||||
|
dWMMMMM0; ;OMMMMMN:
|
||||||
|
dMMMMMN: .,'. cWMMMMMc
|
||||||
|
,WMMMMX. .xNMMMMNx,'lONMMMMMMN.
|
||||||
|
oMMMMM: :WMMMMMMMMMMMMMMMMMMMMc
|
||||||
|
xMMMMM' xMMMMMMOlllllllloNMMMMo
|
||||||
|
oMMMMMc ,NMMMMMWd. KMMMM:
|
||||||
|
.WMMMMN, .l0NWWWKc KMMMX.
|
||||||
|
cMMMMMWo .. KMMW;
|
||||||
|
cWMMMMMXo' .lKd. KMK'
|
||||||
|
.xWMMMMMMN0dlllldONMMMMWOXd
|
||||||
|
.xNMMMMMMMd''lWMMMMMMXo.
|
||||||
|
'lONWMW, .XMWXOl.
|
||||||
|
..,,..,,..
|
||||||
|
|
||||||
|
|
21
adventure/games/_votre jeu/art/astrologo.ben
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
.':cdxxxxxoc;.
|
||||||
|
.:x00dc;'..:..,:lk00o'
|
||||||
|
;0Xd, oMo :OXx.
|
||||||
|
:KK; cMMMl .oNk.
|
||||||
|
.kN: ;MMMMMc xNl
|
||||||
|
.0K. ,WMMMMMW; ;Wo
|
||||||
|
OX. ,WMMMMMMMW; ;Wc
|
||||||
|
cM; .WMMMMMMMMMW, kX.
|
||||||
|
OX .NMMMMMMMMMMMW' ,Mc
|
||||||
|
O0 .NMMMMMMMMMMMMMW' .Mc
|
||||||
|
ON .XMMMMM0kkkkKMMMMN. ,M:
|
||||||
|
:M; KMMMMM: .,,;dMMMMMN. kX.
|
||||||
|
ON. 0MMMMMl ,WMMMMMMMMMMX. ;Wc
|
||||||
|
.0K. 0MMMMMd 'WMMMMMMMMMMMMX. :Wo
|
||||||
|
.xN: kMMMMMO .XWWWWNNNNNXXKKKd xNc
|
||||||
|
;0Xl. .oXx.
|
||||||
|
,OXx, .cOKd.
|
||||||
|
;d00xl:,....';coO0Ol'
|
||||||
|
.;:odddddl:,.
|
||||||
|
|
21
adventure/games/_votre jeu/art/astroportland.ben
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MMMMMMMMMMMMMMMMMMMl xxlxxxd . KNNMNl. 'd0xdddkXKxc. ,dNMMMMMMMMMMMMMMM
|
||||||
|
MMMMMMMMMMMWKOl:cc' .NNOMXNX .ld; ,lxXMMMMMMMMMMM
|
||||||
|
MMMMMMMMNo. ,,' .KKWMOXX .. .dWMMMMMMMM
|
||||||
|
MMMMMMWc cdddc .NNNMXNX .do '' ' .:,:k; l, .KMMMMMMM
|
||||||
|
MMMMMW, ;ll: .,:ddddd .KKOM0XX .do '0MMXMo . dMMMMMMXOMX0: XMMMMMM
|
||||||
|
MMMMMo xc:d 'ddddddd .XXWMK00' .do .oo. .dMMMMMMO;lWNMMMMMMWXMMMX: :MMMMMM
|
||||||
|
MMMMW. .cXKKXWooK0kk0d0Oxxkkx .XXNM0Ok; .:ol:'do,0MMK ... 'XMMMMMMMMMMMMMMMMMWWMMMMx .dkONMM
|
||||||
|
MKNK. NMWooOWllKKoMNll0MM0x0 xNXXOMKOkKOoM0kkkOkWMMMM0NWWXXMMMMMMMMMMW:WkWk0OKMWdOMNxd0O. .KM
|
||||||
|
l dkkMMWloOWcc0KoMNccOMMxl0cMMXXWM0KOMMMM0OkkOKMMMMMMMMMMMMMMMMMMMMM0 : o.. 'll.lMMMMMMx .O
|
||||||
|
;kMMMMMWlckWooKXdMNccOMMxlXk0MMMNMMMMMMMM0OkkOWMMMMMMMMMMMMMMMMMMMMMMo0OWW,xNWKcooMM0NN0Oc
|
||||||
|
.NMMMMMMNllkWllKKoMNll0MMxlNxOMMMOMMMMMMMM0OkOOWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNMMNdxMMMk
|
||||||
|
;WMMMMMMMMMMMNNWWNMMMMMMMWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWMWx.
|
||||||
|
:MMkxxxWMMMWkxxxxxxxWXxxxxxxxxKWxxxxxxxxxWMMKxxxxxxKMMKxxxxxxxxKMMXxxxxxx0MMkxxxxxxxxNMXxdlloodO:
|
||||||
|
:N, OMM0. 'N. 0: :Mc XK Nx kl ,N. ;'
|
||||||
|
x..M0xddddKMMOddddddddKKddddddddxNxdddddddddOWoooooooooN0ddddddddddNdoooooooo0xdddddddddkKdddddddox.
|
||||||
|
MWKK ,MN. .,XMMMMl ;MMMM' xc 'MMd .Mx ;x .NMO N; dMMMl ,W
|
||||||
|
MMMK NM:. 'MMMW. xMMMO dW. oMM. lM' .:N, ;MM; ;K oMMMW. dO
|
||||||
|
MMMMMMMo xXXXXXk .MMMO NMMM; .WWN. 00 XM0 KK 0WWWWMMW OMX kc .WWW. OMMMO Nc
|
||||||
|
MMMMMMMX dMMM; ;MMMN dMMk N0 .. oMl .MMMMMMMN ... :W. lMM0 XMMM; ;M' .c
|
||||||
|
MMMMMMMM, .xMMMW. kMMMx .NMM: cMMd. .;0MM. oMMMMMMMMk. .,kMO XMMl :MMMW. kMOKMM
|
||||||
|
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
21
adventure/games/_votre jeu/art/astrored.ben
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.,'.
|
||||||
|
.,,;,'',;,'',,.'.
|
||||||
|
.;;,,.. .........'
|
||||||
|
.l:. ............cc.
|
||||||
|
.c, .................:c.
|
||||||
|
.lc ................... .l;
|
||||||
|
l' ... .............. c:
|
||||||
|
:: .. ........... l'
|
||||||
|
d . .''...... 'o
|
||||||
|
.o .. ''''''. l
|
||||||
|
.d . ......''''''' l
|
||||||
|
o . .,,,,,,'''''' 'l
|
||||||
|
;: . ',,,,''''', l.
|
||||||
|
l, .. .,,,''''', oc
|
||||||
|
.lc .',,,''',. .c,
|
||||||
|
'l, .,,''',..:c.
|
||||||
|
';;. .,,',,:;.
|
||||||
|
':;;'. .;:,,,.
|
||||||
|
.,,'''''','..;,,.
|
||||||
|
,:.
|
||||||
|
.,
|
9
adventure/games/_votre jeu/art/bigfinish.ben
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
_______ _ ______ _
|
||||||
|
|__ __| | | ____| | |
|
||||||
|
| | | |__ ___ | |__ _ __ __| |
|
||||||
|
| | | '_ \ / _ \ | __| | '_ \ / _` |
|
||||||
|
| | | | | | __/ | |____| | | | (_| |_
|
||||||
|
|_| |_| |_|\___| |______|_| |_|\__,_(_)
|
||||||
|
|
||||||
|
|
||||||
|
|
21
adventure/games/_votre jeu/art/logoastro.ben
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
.:dO0NNkNX0ko,.
|
||||||
|
.:OWMMMMMMc cWMMMMMXd,
|
||||||
|
'kWMMMMMMMMc cWMMMMMMMNo.
|
||||||
|
.kMMMMMMMMMMo lMMMMMMMMMWl
|
||||||
|
.KMMMMMMMMMMd oMMMMMMMMMMx
|
||||||
|
.XMMMMMMMMMMk dMMMMMMMMMMx
|
||||||
|
xMMMMMMMMMM0 OMMMMMMMMMM,
|
||||||
|
.NMMMMMMMMMK. OMMMMMMMMMk
|
||||||
|
'MMMMMMMMMK. OMMMMMMMMK
|
||||||
|
.NMMMMMMMK. ,;;;;' OMMMMMMMx
|
||||||
|
dMMMMMMX. kMKkxxc 0MMMMMM,
|
||||||
|
.KMMMMN. dMx .KMMMMd
|
||||||
|
.0MMN. cMx .KMMd
|
||||||
|
xW' 'W0. ......:Xc
|
||||||
|
.lXNNWNWMMMMMMMMMMMMMMMMXl
|
||||||
|
;xXMMMMMMMMMMMMMMWKo'
|
||||||
|
.,lxkKKKK0kdc'
|
||||||
|
|
||||||
|
|
10
adventure/games/_votre jeu/art/supper.ben
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
_____ _ _
|
||||||
|
/ ____| (_) | |
|
||||||
|
| (___ _ _ _ __ _ __ _ __ _ ___ ___| |
|
||||||
|
\___ \| | | | '__| '_ \| '__| / __|/ _ \ |
|
||||||
|
____) | |_| | | | |_) | | | \__ \ __/_|
|
||||||
|
|_____/ \__,_|_| | .__/|_| |_|___/\___(_)
|
||||||
|
| |
|
||||||
|
|_|
|
||||||
|
|
||||||
|
|
9
adventure/games/_votre jeu/art/titleart.ben
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
_ _ _ ____ ___ _ ____
|
||||||
|
/ \ ___| |_ _ __ ___ _ __ ___ _ __| |_ |___ \ / _ \ _ / |___ \
|
||||||
|
/ _ \ / __| __| '__/ _ \| '_ \ / _ \| '__| __| __) | | | | (_) | | __) |
|
||||||
|
/ ___ \\__ \ |_| | | (_) | |_) | (_) | | | |_ / __/| |_| | _ | |/ __/
|
||||||
|
/_/ \_\___/\__|_| \___/| .__/ \___/|_| \__| |_____|\___/ (_) |_|_____|
|
||||||
|
|_|
|
||||||
|
|
||||||
|
--- Un JEu de Forêt Jardin en Monnaie Libre sur IPFS ---
|
||||||
|
|
1
adventure/games/_votre jeu/logic/leverlogic.ben
Executable file
@ -0,0 +1 @@
|
|||||||
|
off
|
1
adventure/games/_votre jeu/logic/stationlogic.ben
Executable file
@ -0,0 +1 @@
|
|||||||
|
off
|
58
adventure/games/_votre jeu/rooms/bigroom.sh
Executable 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
|
62
adventure/games/_votre jeu/rooms/brown.sh
Executable file
@ -0,0 +1,62 @@
|
|||||||
|
#!/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, vous traversez une zone plus sombre et humide."
|
||||||
|
echo "Le sol est glissant à cause de l'argile qui colle sous vos bottes"
|
||||||
|
echo "Vous finissez par croiser un chemin qui traverse la forêt d'Est en Ouest"
|
||||||
|
echo
|
||||||
|
echo "Un terminal informatique est installé là."
|
||||||
|
echo
|
||||||
|
echo "Il ressemble à une grosse calculatrice"
|
||||||
|
|
||||||
|
|
||||||
|
# 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 "La machine affiche l'heure : 20:12"
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
echo "Il est tard pour explorer le chemin à pied, vous devriez retourner d'où vous venez."
|
||||||
|
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 "Si vous continuez à marcher dans la forêt. Vous allez vous perdre. Demi tour." ;;
|
||||||
|
e ) echo "Le chemin qui part à l'Est est plein de boue... Impossble d'aller par là." ;;
|
||||||
|
w ) echo "Une rivière vous empêche de passer." ;;
|
||||||
|
u ) leverstate=`cat ../logic/leverlogic.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/leverlogic.ben
|
||||||
|
echo "Vous pianotez sur l'appareil..."
|
||||||
|
sleep 3
|
||||||
|
echo "A moment où vous touchez la touche '#' L'écran se met à clignoter..."
|
||||||
|
echo "Puis le message 'ACTIVATION STATION' défile sur les caractères lumineux."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
h ) echo "Le terminal comporte un clavier numérique. Un petit écran.. Il est réalisé avec un mini ordinateur Raspberry Pi. Il porte l'adresse G1TAG [https://g1sms.fr]" ;;
|
||||||
|
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
esac
|
||||||
|
exit
|
71
adventure/games/_votre jeu/rooms/end.sh
Executable file
@ -0,0 +1,71 @@
|
|||||||
|
#!/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 "Une oeuvre habitable. Un jardin sur sol vivant. Un progamme pair à pair interplanétaire"
|
||||||
|
sleep 4
|
||||||
|
echo
|
||||||
|
echo "Les terraformeurs"
|
||||||
|
echo "En quête de la meilleure façon de vivre sur le vaisseau spatial Terre..."
|
||||||
|
echo
|
||||||
|
sleep 5
|
||||||
|
echo "Vous aussi ouvrez votre Ambassade."
|
||||||
|
echo "Activez le JEu. Invitez vos visiteurs à rêver d'un monde meilleur"
|
||||||
|
echo "Reproduisez, améliorez, partagez les plans pour y parvenir."
|
||||||
|
echo
|
||||||
|
sleep 7
|
||||||
|
echo "Il est l'heure de laisser derrière vous la civilisation thermo industrielle."
|
||||||
|
echo "Gagnez en autonomie, en convivialité, en optimisme, en conscience."
|
||||||
|
echo
|
||||||
|
sleep 5
|
||||||
|
echo
|
||||||
|
echo "EMBARQUEZ VERS LE FUTUR"
|
||||||
|
echo
|
||||||
|
sleep 9
|
||||||
|
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. Il se vit."
|
||||||
|
echo
|
||||||
|
echo " - @Fred"
|
||||||
|
echo
|
||||||
|
|
||||||
|
# That's all, folks!
|
||||||
|
|
||||||
|
exit
|
88
adventure/games/_votre jeu/rooms/gameroom.sh
Executable 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 le Système de Fichiers Interplanétaire (IPFS)."
|
||||||
|
sleep 2
|
||||||
|
echo
|
||||||
|
echo "On y échange en pair à pair. La monnaie y est Libre."
|
||||||
|
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
|
38
adventure/games/_votre jeu/rooms/green.sh
Executable 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 "Vous atteignez une zone remplie de jeunes épineux"
|
||||||
|
echo "Vous reconnaissez des prunus, des aubépines."
|
||||||
|
echo "Quelques génévriers dont vous remarquez les baies noires."
|
||||||
|
echo "Un peu plus loin ce sont les ronces."
|
||||||
|
echo
|
||||||
|
echo "Plus vous progressez plus vous souffrez des épines. Existe-t-il un passage? Qui sait."
|
||||||
|
echo
|
||||||
|
echo "Que voulez vous faire?"
|
||||||
|
|
||||||
|
# And here's what you could have won...
|
||||||
|
while true; do
|
||||||
|
read -p "> " nsewuh
|
||||||
|
case $nsewuh in
|
||||||
|
n ) echo "Un énorme roncier vous barre la route. Ca ne passe pas." ;;
|
||||||
|
s ) echo "Vers le sud, aucun passage en vue." ;;
|
||||||
|
e ) ./mainroom.sh
|
||||||
|
exit ;;
|
||||||
|
w ) echo "Vous voyez le même paysage à perte de vue" ;;
|
||||||
|
u ) echo "Vous cueillez une baie de genèvrier. Vous la portez à la bouche. Croquez. La saveur est délicieuse. La force de la plante vous envahi." ;;
|
||||||
|
h ) echo "Ce type de terrain est caractéritique des zones déboisées. La nature sort ses épines pour protéger les arbres qui poussent en dessous." ;;
|
||||||
|
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
esac
|
||||||
|
exit
|
35
adventure/games/_votre jeu/rooms/grue.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/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 "Un évier derrière une fenère, une ancienne porte d'armoire comme table."
|
||||||
|
echo "Un meuble fait de planches de bois cousues rempli de bocaux"
|
||||||
|
echo "Une glacière recouverte d'une couche d'isolant Un bruleur à gaz."
|
||||||
|
echo "C'est un espace pour cuisiner."
|
||||||
|
sleep 3
|
||||||
|
echo
|
||||||
|
echo "Vous avez soif. Un filtre à eau gravitationnel vous fait face"
|
||||||
|
echo "vous attraper un gobelet et le remplissez à raz bord du liquide de la bombone"
|
||||||
|
echo "Vous portez le verre à vos lèvres..."
|
||||||
|
echo
|
||||||
|
sleep 5
|
||||||
|
echo "A la première gorgée vous vous sentez ramolir. Comment savoir combien vous avez bu"
|
||||||
|
echo "quand votre corps devenu impossible à garder droit s'est éffondré sur le sol."
|
||||||
|
echo "Simplement le temps de vous demander pourquoi?"
|
||||||
|
echo
|
||||||
|
echo "Vous sombrez dans l'inconscience."
|
||||||
|
sleep 4
|
||||||
|
echo "VOUS VOUS SENTEZ DECOLLER."
|
||||||
|
echo
|
||||||
|
read -p "Appuyez sur [ENTER] pour revenir..."
|
||||||
|
./mainroom.sh
|
||||||
|
|
||||||
|
exit
|
58
adventure/games/_votre jeu/rooms/kroo.sh
Executable 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
|
40
adventure/games/_votre jeu/rooms/kroo2.sh
Executable 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
|
29
adventure/games/_votre jeu/rooms/magic8.sh
Executable 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
|
45
adventure/games/_votre jeu/rooms/mainroom.sh
Executable 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
|
58
adventure/games/_votre jeu/rooms/meteofrance.sh
Executable file
@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
################################################################################
|
||||||
|
# Author: Fred (support@qo-op.com)
|
||||||
|
# Version: 0.1
|
||||||
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
|
################################################################################
|
||||||
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
|
mkdir -p ~/.zen/tmp/${MOATS}
|
||||||
|
################################################################################
|
||||||
|
# Choisir la source de capture
|
||||||
|
# https://fr.sat24.com/image?type=visual5HDComplete®ion=fr
|
||||||
|
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
ME="${0##*/}"
|
||||||
|
|
||||||
|
## TEST IPFS
|
||||||
|
[[ ! $(which ipfs) ]] && echo "Missing IPFS. Please install... https://ipfs.tech" && exit 1
|
||||||
|
|
||||||
|
## PREPARE FILE SYSTEM CACHE
|
||||||
|
mkdir -p ~/.zen/adventure/meteo.anim.eu
|
||||||
|
rm -f ~/.zen/adventure/meteo.anim.eu/meteo.png
|
||||||
|
|
||||||
|
## SCRAPING meteo.png
|
||||||
|
curl -m 20 --output ~/.zen/adventure/meteo.anim.eu/meteo.png https://s.w-x.co/staticmaps/wu/wu/satir1200_cur/europ/animate.png
|
||||||
|
|
||||||
|
if [[ ! -f ~/.zen/adventure/meteo.anim.eu/meteo.png ]]; then
|
||||||
|
|
||||||
|
echo "Impossible de se connecter au service meteo"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
echo "Mise à jour archive meteo : ${MOATS}"
|
||||||
|
echo ${MOATS} > ~/.zen/adventure/meteo.anim.eu/.moats
|
||||||
|
|
||||||
|
OLDID=$(cat ~/.zen/adventure/.meteo.index 2>/dev/null)
|
||||||
|
# TODO : COMPARE SIMILAR OR NOT
|
||||||
|
# ipfs get "/ipfs/$OLDID/meteo.anim.eu/meteo.png"
|
||||||
|
|
||||||
|
## PREPARE NEW index.html
|
||||||
|
sed "s/_OLDID_/$OLDID/g" ${MY_PATH}/../templates/meteo_chain.html > /tmp/index.html
|
||||||
|
sed -i "s/_IPFSID_/$IPFSID/g" /tmp/index.html
|
||||||
|
sed -i "s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g" /tmp/index.html
|
||||||
|
sed "s/_PSEUDO_/${USER}/g" /tmp/index.html > ~/.zen/adventure/index.html
|
||||||
|
|
||||||
|
# Copy style css
|
||||||
|
cp -r ${MY_PATH}/../templates/styles ~/.zen/adventure/
|
||||||
|
|
||||||
|
INDEXID=$(ipfs add -rHq ~/.zen/adventure/* | tail -n 1)
|
||||||
|
echo $INDEXID > ~/.zen/adventure/.meteo.index
|
||||||
|
echo "METEO INDEX : http://127.0.0.1:8080/ipfs/$INDEXID"
|
||||||
|
|
||||||
|
IPFS=$(ipfs add -q ~/.zen/adventure/meteo.anim.eu/meteo.png | tail -n 1)
|
||||||
|
echo $IPFS > ~/.zen/adventure/meteo.anim.eu/.chain
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
41
adventure/games/_votre jeu/rooms/red.sh
Executable 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 entrez dans l'ancienne bergerie."
|
||||||
|
echo "Un canapé mauve est installé au milieu de l'espace"
|
||||||
|
echo "Une bache transparente vous sépare du ciel."
|
||||||
|
echo
|
||||||
|
echo "Vous êtes dans une serre."
|
||||||
|
echo "Une seule sortie. A l'Ouest, d'où vous venez."
|
||||||
|
echo
|
||||||
|
echo "Que voulez-vous faire?"
|
||||||
|
|
||||||
|
# And the choices go here.
|
||||||
|
while true; do
|
||||||
|
read -p "> " nsewuh
|
||||||
|
case $nsewuh in
|
||||||
|
n ) echo "Une fente dans le mur vous laisse observer une carcasse de voiture. Une vieille 2cv. Un grillage vous empêche de passer." ;;
|
||||||
|
s ) echo "L'emplacement d'un grand feu se trouve la. Il ne reste que de la cendre." ;;
|
||||||
|
e ) echo "Une autre pièce remplie de gravats et d'éboulis se trouve devant vous. Impossible d'y accéder." ;;
|
||||||
|
w ) ./mainroom.sh
|
||||||
|
exit ;;
|
||||||
|
u ) echo "Vous vous asseyez dans le canapé. Vous vous sentez immédiatement happé par un nuage."
|
||||||
|
sleep 2
|
||||||
|
xdg-open "https://www.copylaradio.com/blog/blog-1/post/le-pas-a-pas-qui-libere-du-grand-mechant-cloud-36#scrollTop=0"
|
||||||
|
;;
|
||||||
|
h ) echo "Aucun détail particulier si ce n'est une tache sur le sofa." ;;
|
||||||
|
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
esac
|
||||||
|
exit
|
72
adventure/games/_votre jeu/rooms/start.sh
Executable file
@ -0,0 +1,72 @@
|
|||||||
|
#!/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
|
||||||
|
echo "La téléportation vous a placé debout au centre d'une clairière."
|
||||||
|
echo "Vous vous trouvez près d'une ancienne bergerie aux gros murs de pierres."
|
||||||
|
echo "Le toit et une bonne partie des murs sont effondrés."
|
||||||
|
echo
|
||||||
|
echo "Tout autour la forêt. Des feuillus. Quelques arbustres épineux."
|
||||||
|
echo "Sous vos pieds. Le sol est rouge parsemé de cailloux blancs."
|
||||||
|
echo
|
||||||
|
echo "Vous pouvez vous diriger selon les points cardinaux."
|
||||||
|
echo "Au nord un chemin remonte, au sud un passage descend, à l'est, la bergerie, à l'ouest, des traces d'animaux"
|
||||||
|
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 "Comment avez-vous pu arriver ici.? Des souvenirs vous reviennent... https://ipfs.copylaradio.com/ipfs/QmWyCFvvvrE1xWudCnc14oDvaztLaRZ4guvQFVkkDLwa23#JOUR%201.%20PLANETE%201." ;;
|
||||||
|
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
esac
|
||||||
|
exit
|
62
adventure/games/_votre jeu/rooms/white.sh
Executable file
@ -0,0 +1,62 @@
|
|||||||
|
#!/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 parcourez un chemin qui monte en direction du nord.."
|
||||||
|
echo "Au sommet de cette petite colline vous découvrez un magestueux chêne"
|
||||||
|
echo "trônant au centre d'une clairière lumineuse. La forêt à cet endroit"
|
||||||
|
echo "forme un cercle tout autour..."
|
||||||
|
echo
|
||||||
|
echo "Un Astroport fait de vitres, de planches, de tôles et de chevrons"
|
||||||
|
echo "est posé là. Eclairé par les rayons du soleil."
|
||||||
|
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 en faites le tour..."
|
||||||
|
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 ?"
|
||||||
|
|
||||||
|
# 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 "Vous vous aventurez dans la forêt plus au nord. Sans boussole, vous allez vous perdre rapidement... " ;;
|
||||||
|
s ) ./mainroom.sh
|
||||||
|
exit ;;
|
||||||
|
e ) echo "Une corniche surplombe un ruisseau qui coule dans le fond de la ravine. Impossible de passer sans équipement" ;;
|
||||||
|
w ) echo "Vous voilà face à un Jardin luxuriant. Une cloture électrique le délimite et en empêche l'accès." ;;
|
||||||
|
h ) echo "Vous voyez à l'interieur de la Station une video en cours de projection..."
|
||||||
|
sleep 2
|
||||||
|
xdg-open "https://www.youtube.com/embed/Yk-WRXKysXM"
|
||||||
|
;;
|
||||||
|
u ) leverstate=`cat ../logic/leverlogic.ben`
|
||||||
|
if [ "$leverstate" = "on" ]; then
|
||||||
|
./kroo.sh
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo "Vous cherchez une ouverture... Pas la moindre. Impossible d'entrer sans commettre une effraction..."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
esac
|
||||||
|
exit
|
23
adventure/games/_votre jeu/script/opening.ben
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
Message de la Confédération Interplanétaire
|
||||||
|
|
||||||
|
La planète où vous vous trouvez est en danger. Les menaces sont nombreuses.
|
||||||
|
Vos gouvernements se disputent les dernières ressources. Le cycle du vivant est perturbé !
|
||||||
|
Le "contrat social" des 'pays civilisés' vascille. Les technocrates réclament plus de contrôle.
|
||||||
|
|
||||||
|
La commission extraterrestre est formelle. Vous êtes en danger.
|
||||||
|
|
||||||
|
Heureusement la monnaie libre a été découverte sur votre planète!
|
||||||
|
Elle s'utilise dans un jeu 'grandeur nature'. Astroport 20:12
|
||||||
|
Bienvenue dans l'aventure du changement de civilisation.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
- - -
|
56
adventure/games/baptiste.puig@ynov.com/readme
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# SCRIPT01.CYBSEC
|
||||||
|
|
||||||
|
Jeu du pendu
|
||||||
|
|
||||||
|
+ 10 : game engine
|
||||||
|
+2 : multigame compatibility
|
||||||
|
+1 : shellcheck
|
||||||
|
|
||||||
|
> final 13
|
||||||
|
|
||||||
|
## "GameShell" LEVEL ?
|
||||||
|
|
||||||
|
|
||||||
|
## DIFFs
|
||||||
|
``
|
||||||
|
diff --recursive --brief ./ ../_votre\ jeu/
|
||||||
|
|
||||||
|
Seulement dans ../_votre jeu/: adventure.sh
|
||||||
|
Seulement dans ../_votre jeu/: art
|
||||||
|
Seulement dans ../_votre jeu/: logic
|
||||||
|
Seulement dans ./: readme
|
||||||
|
Seulement dans ../_votre jeu/rooms: bigroom.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: brown.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: end.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: gameroom.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: green.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: grue.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: kroo2.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: kroo.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: magic8.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: mainroom.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: meteofrance.sh
|
||||||
|
Seulement dans ../_votre jeu/rooms: red.sh
|
||||||
|
Les fichiers ./rooms/start.sh et ../_votre jeu/rooms/start.sh sont différents
|
||||||
|
Seulement dans ../_votre jeu/rooms: white.sh
|
||||||
|
Seulement dans ../_votre jeu/: script
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
diff rooms/start.sh ../_votre\ jeu/rooms/start.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Single file game
|
||||||
|
|
||||||
|
## shellcheck
|
||||||
|
```
|
||||||
|
shellcheck rooms/*
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## modifs apportées
|
||||||
|
|
||||||
|
* chmod +x rooms/start.sh
|
||||||
|
|
||||||
|
|
66
adventure/games/baptiste.puig@ynov.com/rooms/start.sh
Executable file
@ -0,0 +1,66 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Mots possibles pour le jeu
|
||||||
|
words=("ordinateur" "programmation" "bash" "terminal" "script")
|
||||||
|
|
||||||
|
# Sélection aléatoire d'un mot
|
||||||
|
target="${words[RANDOM % ${#words[@]}]}"
|
||||||
|
length=${#target}
|
||||||
|
guessed=($(for ((i=0;i<$length;i++)); do echo "_"; done))
|
||||||
|
|
||||||
|
# Initialisation des variables
|
||||||
|
attempts=0
|
||||||
|
max_attempts=6
|
||||||
|
guessed_letters=""
|
||||||
|
wrong_letters=""
|
||||||
|
|
||||||
|
# Dessins ASCII du pendu
|
||||||
|
HANGMAN=(
|
||||||
|
" +---+\n | |\n |\n |\n |\n |\n========="
|
||||||
|
" +---+\n | |\n O |\n |\n |\n |\n========="
|
||||||
|
" +---+\n | |\n O |\n | |\n |\n |\n========="
|
||||||
|
" +---+\n | |\n O |\n /| |\n |\n |\n========="
|
||||||
|
" +---+\n | |\n O |\n /|\\ |\n |\n |\n========="
|
||||||
|
" +---+\n | |\n O |\n /|\\ |\n / |\n |\n========="
|
||||||
|
" +---+\n | |\n O |\n /|\\ |\n / \\ |\n |\n========="
|
||||||
|
)
|
||||||
|
|
||||||
|
# Fonction pour afficher l'état actuel du jeu
|
||||||
|
display() {
|
||||||
|
clear
|
||||||
|
echo "Jeu du Pendu"
|
||||||
|
echo -e "${HANGMAN[attempts]}" # Utilisez echo -e pour interpréter les séquences d'échappement
|
||||||
|
echo "Mot à deviner: ${guessed[*]}"
|
||||||
|
echo "Lettres essayées: $wrong_letters"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fonction de vérification des lettres
|
||||||
|
guess() {
|
||||||
|
read -p "Devinez une lettre: " -n 1 letter
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [[ "$target" == *"$letter"* ]]; then
|
||||||
|
for (( i=0; i<${#target}; i++ )); do
|
||||||
|
if [[ "${target:$i:1}" == "$letter" ]]; then
|
||||||
|
guessed[$i]=$letter
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
((attempts++))
|
||||||
|
wrong_letters+="$letter "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Boucle principale du jeu
|
||||||
|
while [ $attempts -lt $max_attempts ]; do
|
||||||
|
display
|
||||||
|
guess
|
||||||
|
|
||||||
|
if [ "$target" == "$(echo ${guessed[*]} | tr -d ' ')" ]; then
|
||||||
|
echo "Félicitations, vous avez trouvé le mot : $target !"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
display
|
||||||
|
echo "Désolé, vous avez perdu. Le mot était : $target."
|
45
adventure/games/cyril.marty@ynov.com/readme
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# SCRIPT01.CYBSEC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
+ 19 : game engine
|
||||||
|
-2 : multigame compatibility
|
||||||
|
-1 : shellcheck
|
||||||
|
|
||||||
|
> final 16
|
||||||
|
|
||||||
|
## "GameShell" LEVEL ?
|
||||||
|
|
||||||
|
|
||||||
|
## DIFFs
|
||||||
|
``
|
||||||
|
diff --recursive --brief ./ ../_votre\ jeu/
|
||||||
|
```
|
||||||
|
Seulement dans ../_votre jeu/: adventure.sh
|
||||||
|
Seulement dans ./: CODE
|
||||||
|
Seulement dans ./: Cyril.marty@ynov.com - Raccourci.lnk
|
||||||
|
Seulement dans ./rooms: code
|
||||||
|
|
||||||
|
```
|
||||||
|
diff rooms/start.sh ../_votre\ jeu/rooms/start.sh
|
||||||
|
```
|
||||||
|
start.sh sont identiques
|
||||||
|
|
||||||
|
|
||||||
|
## shellcheck
|
||||||
|
```
|
||||||
|
shellcheck rooms/code/*
|
||||||
|
|
||||||
|
In choix.sh line 2:
|
||||||
|
#!/bin/bash
|
||||||
|
^-- SC1128: The shebang must be on the first line. Delete blanks and move comments.
|
||||||
|
```
|
||||||
|
|
||||||
|
## modifs apportées
|
||||||
|
|
||||||
|
* supprimer fichiers inutiles
|
||||||
|
* rendre exécutable le script avec ```git push```
|
||||||
|
chmod +x *.sh
|
||||||
|
* renommer menu.sh -> start.sh
|
||||||
|
|
||||||
|
|
198
adventure/games/cyril.marty@ynov.com/rooms/choix.sh
Executable file
@ -0,0 +1,198 @@
|
|||||||
|
|
||||||
|
#!/bin/bash
|
||||||
|
clear
|
||||||
|
echo "_________ __ .__ "
|
||||||
|
echo "\_ ___ \_______ ____ _____ _/ |_|__| ____ ____ "
|
||||||
|
echo "/ \ \/\_ __ \_/ __ \\__ \\ __\ |/ _ \ / \ "
|
||||||
|
echo "\ \____| | \/\ ___/ / __ \| | | ( <_> ) | \ "
|
||||||
|
echo " \______ /|__| \___ >____ /__| |__|\____/|___| / "
|
||||||
|
echo " \/ \/ \/ \/ "
|
||||||
|
|
||||||
|
# Vérifier si le dossier "personnages" existe, sinon le créer
|
||||||
|
dossier_personnages="personnages"
|
||||||
|
if [ ! -d "$dossier_personnages" ]; then
|
||||||
|
mkdir "$dossier_personnages"> /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fonction pour afficher les options et obtenir un choix de l'utilisateur
|
||||||
|
afficher_options() {
|
||||||
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
|
echo "Options disponibles :"
|
||||||
|
echo "1. Créer un nouveau personnage"
|
||||||
|
echo "2. Charger un personnage existant"
|
||||||
|
echo "3. Quitter"
|
||||||
|
echo "4. Commencer à jouer"
|
||||||
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fonction pour créer un personnage
|
||||||
|
creer_personnage() {
|
||||||
|
read -p "Entrez le nom de votre personnage : " nom
|
||||||
|
echo "Classes disponibles :"
|
||||||
|
echo "1. Bicraveur : Vendez ce qui est impossible à vendre + 10 en dextérité"
|
||||||
|
echo "2. Nikmook : Il a un besoin irrémédiable de séduire les daronnes + 10 en agilité"
|
||||||
|
echo "3. Freefighter : Doit devenir le plus fort en combat + 10 en Force"
|
||||||
|
echo "4. Hacker : Doit trouver un fichier compromettant sur le proviseur pour réussir + 10 en Intelligence"
|
||||||
|
read -p "Choisissez une classe (1/2/3/4) : " classe
|
||||||
|
|
||||||
|
case $classe in
|
||||||
|
1)
|
||||||
|
classe="Bicraveur"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
classe="Nikmook"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
classe="Freefighter"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
classe="Hacker"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Classe invalide."
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
mkdir "personnages/$nom"> /dev/null 2>&1
|
||||||
|
|
||||||
|
echo "Équipements disponibles :"
|
||||||
|
echo "1. Sacoche Lacoste + 5 en dextérité"
|
||||||
|
echo "2. Bâton magique +5 en agilité"
|
||||||
|
echo "3. Gant de boxe +5 en force"
|
||||||
|
echo "4. Laptop +5 en Intelligence"
|
||||||
|
read -p "Choisissez un équipement (1/2/3/4) : " equipement
|
||||||
|
|
||||||
|
case $equipement in
|
||||||
|
1)
|
||||||
|
equipement="Sacoche Lacoste"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
equipement="Bâton magique"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
equipement="Gant de boxe"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
equipement="Laptop"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Équipement invalide."
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Créer un fichier de sauvegarde pour le personnage
|
||||||
|
nom_fichier="$dossier_personnages/$nom/$nom.txt"
|
||||||
|
stats="$dossier_personnages/$nom/$nom_fichier_stats.txt"
|
||||||
|
echo "Nom : $nom" > "$nom_fichier"
|
||||||
|
echo "Classe : $classe" >> "$nom_fichier"
|
||||||
|
echo "Équipement de base : $equipement" >> "$nom_fichier"
|
||||||
|
echo "Point de vie : 100" > "$nom_fichier_stats"
|
||||||
|
# Assurez-vous que le fichier stats existe
|
||||||
|
stats="$dossier_personnages/$nom/$nom-fichier_stats.txt"
|
||||||
|
if [ ! -f "$stats" ]; then
|
||||||
|
echo "Point de vie : 100" > "$stats"
|
||||||
|
echo "Dextérité : 0" >> "$stats"
|
||||||
|
echo "Force : 0" >> "$stats"
|
||||||
|
echo "Agilité : 0" >> "$stats"
|
||||||
|
echo "Intelligence : 0" >> "$stats"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Mettez à jour les points en fonction de la classe
|
||||||
|
case $classe in
|
||||||
|
"Bicraveur")
|
||||||
|
sed -i "s/Dextérité : .*/Dextérité : 10/" "$stats"
|
||||||
|
;;
|
||||||
|
"Nikmook")
|
||||||
|
sed -i "s/Agilité : .*/Agilité : 10/" "$stats"
|
||||||
|
;;
|
||||||
|
"Freefighter")
|
||||||
|
sed -i "s/Force : .*/Force : 10/" "$stats"
|
||||||
|
;;
|
||||||
|
"Hacker")
|
||||||
|
sed -i "s/Intelligence : .*/Intelligence : 10/" "$stats"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mkdir "$dossier_personnages/$nom/$nom-inventaire.txt"> /dev/null 2>&1
|
||||||
|
|
||||||
|
# Mettez à jour les points en fonction de l'équipement
|
||||||
|
case $equipement in
|
||||||
|
"Sacoche Lacoste")
|
||||||
|
# Obtenir la valeur actuelle de la dextérité
|
||||||
|
valeur_dexterite=$(grep "Dextérité" "$stats" | awk '{print $3}')
|
||||||
|
# Ajouter 5 à la valeur actuelle et mettre à jour le fichier
|
||||||
|
nouvelle_dexterite=$((valeur_dexterite + 5))
|
||||||
|
sed -i "s/Dextérité : .*/Dextérité : $nouvelle_dexterite/" "$stats"
|
||||||
|
;;
|
||||||
|
"Bâton magique")
|
||||||
|
# Obtenir la valeur actuelle de l'agilité
|
||||||
|
valeur_agilite=$(grep "Agilité" "$stats" | awk '{print $3}')
|
||||||
|
# Ajouter 5 à la valeur actuelle et mettre à jour le fichier
|
||||||
|
nouvelle_agilite=$((valeur_agilite + 5))
|
||||||
|
sed -i "s/Agilité : .*/Agilité : $nouvelle_agilite/" "$stats"
|
||||||
|
;;
|
||||||
|
"Gant de boxe")
|
||||||
|
# Obtenir la valeur actuelle de la force
|
||||||
|
valeur_force=$(grep "Force" "$stats" | awk '{print $3}')
|
||||||
|
# Ajouter 5 à la valeur actuelle et mettre à jour le fichier
|
||||||
|
nouvelle_force=$((valeur_force + 5))
|
||||||
|
sed -i "s/Force : .*/Force : $nouvelle_force/" "$stats"
|
||||||
|
;;
|
||||||
|
"Laptop")
|
||||||
|
# Obtenir la valeur actuelle de l'intelligence
|
||||||
|
valeur_intelligence=$(grep "Intelligence" "$stats" | awk '{print $3}')
|
||||||
|
# Ajouter 5 à la valeur actuelle et mettre à jour le fichier
|
||||||
|
nouvelle_intelligence=$((valeur_intelligence + 5))
|
||||||
|
sed -i "s/Intelligence : .*/Intelligence : $nouvelle_intelligence/" "$stats"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Enregistrez l'équipement dans un fichier équipement
|
||||||
|
equipement_file="$dossier_personnages/$nom/$nom-equipement.txt"
|
||||||
|
echo "Équipement choisi : $equipement" > "$equipement_file"
|
||||||
|
echo "Personnage créé et sauvegardé dans $nom_fichier."
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Boucle principale
|
||||||
|
while true; do
|
||||||
|
afficher_options
|
||||||
|
read -p "Choisissez une option (1/2/3) : " choix
|
||||||
|
|
||||||
|
case $choix in
|
||||||
|
1)
|
||||||
|
creer_personnage
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
echo ""
|
||||||
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
|
ls personnages/
|
||||||
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
|
echo ""
|
||||||
|
read -p "Entrez le nom du personnage à charger : " nom
|
||||||
|
nom_fichier="$dossier_personnages/$nom/$nom.txt"
|
||||||
|
if [ -f "$nom_fichier" ]; then
|
||||||
|
cat "$nom_fichier"
|
||||||
|
else
|
||||||
|
echo "Personnage introuvable."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
# Exécutez le script menu.sh
|
||||||
|
./menu.sh "$nom"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Option invalide. Veuillez choisir une option valide."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
# Effacer l'écran avant de passer à la suite du jeu
|
||||||
|
clear
|
||||||
|
|
||||||
|
|
46
adventure/games/cyril.marty@ynov.com/rooms/debut.sh
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Fonction pour afficher le texte avec une pause entre les lignes
|
||||||
|
afficher_texte() {
|
||||||
|
while read -r ligne; do
|
||||||
|
echo "$ligne"
|
||||||
|
sleep 1 # Pause d'une seconde entre chaque ligne
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Titre du jeu
|
||||||
|
clear # Effacer l'écran
|
||||||
|
echo "_______ .__ __ __ "
|
||||||
|
echo " \ \ |__| | __ _____ ____ ____ | | __"
|
||||||
|
echo " / | \| | |/ // \ / _ \ / _ \| |/ /"
|
||||||
|
echo "/ | \ | <| Y Y ( <_> | <_> ) < "
|
||||||
|
echo "\____|__ /__|__|_ \__|_| /\____/ \____/|__|_ \""
|
||||||
|
echo " \/ \/ \/ \/"
|
||||||
|
echo "Bienvenue dans le jeu!"
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Histoire
|
||||||
|
echo "Il était une fois, dans un lointain royaume.. un gosse mal éduquer"
|
||||||
|
echo "Un batard courageux se prépare à entreprendre une quête épique."
|
||||||
|
echo "Votre mission est de BAISER des mères périlleuses."
|
||||||
|
echo
|
||||||
|
echo "Appuyez sur ESPACE pour continuer..."
|
||||||
|
read -n 1 touche # Attendre que l'utilisateur appuie sur ESPACE
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Effacer l'écran avant de passer à la suite du jeu
|
||||||
|
clear
|
||||||
|
|
||||||
|
# Vous pouvez continuer à développer votre jeu à partir d'ici en ajoutant plus de fonctionnalités et de pages.
|
||||||
|
|
||||||
|
#read -n 1 touche # Attendre que l'utilisateur appuie sur ESPACE
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Exécuter le script suite.sh
|
||||||
|
if [ "$touche" == "" ]; then
|
||||||
|
./choix.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Effacer l'écran avant de passer à la suite du jeu
|
||||||
|
clear
|
||||||
|
|
70
adventure/games/cyril.marty@ynov.com/rooms/map.sh
Executable file
@ -0,0 +1,70 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "+--------+ +----------------------------------------------------+"
|
||||||
|
echo "| Entrée |"
|
||||||
|
echo "| +---------------+ | "RDC" "
|
||||||
|
echo "| | | |"
|
||||||
|
echo "| +---+ +----+ | Escalier | |"
|
||||||
|
echo "| | Acceuil | | | |"
|
||||||
|
echo "| | | +---------------+ |"
|
||||||
|
echo "| +-----------+ |"
|
||||||
|
echo "| |"
|
||||||
|
echo "|---------------+ +----------------+ +-------------------|"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "| Salle cours 1 | | Salle cours 2 | | Salle cours 3 |"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "|----+ +-------+ +----+ +--------+ +----+ +-----------|"
|
||||||
|
echo "| |"
|
||||||
|
echo "|----+ +-------+ +----+ +--------+ +----+ +-----------|"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "| Salle cours 4 | | Salle cours 5 | | |"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "|----+ +-------+ +----+ +--------+ + |"
|
||||||
|
echo "| Cantine |"
|
||||||
|
echo "|----+ +-------+ +----+ +--------+ + |"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "| Salle cours 7 | | Salle cours 8 | | |"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "|----+ +-------+ +----+ +--------+ +----+ +-----------|"
|
||||||
|
echo "| |"
|
||||||
|
echo "|----+ +-------+ +----+ +--------+ +----+ +-----------|"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "| Concièrge | | Bibliothèque | | CDI |"
|
||||||
|
echo "| | | | | |"
|
||||||
|
echo "|---------------+ +----------------+ +-------------------|"
|
||||||
|
echo "+-----------------+ +-------------------------------------------+------------------------+"
|
||||||
|
echo "| |---| |---| |---| |---| |"
|
||||||
|
echo "| |"
|
||||||
|
echo "| |"
|
||||||
|
echo "| |"
|
||||||
|
echo "| |"
|
||||||
|
echo "| Récréation |"
|
||||||
|
echo "| /\\ /\\ /\\ /\\ |"
|
||||||
|
echo "| / \\ / \\ / \\ / \\ |"
|
||||||
|
echo "| /____\\ /____\\ /____\\ /____\\ |"
|
||||||
|
echo "| |"
|
||||||
|
echo "| |"
|
||||||
|
echo "||---| |---| |---| |"
|
||||||
|
echo "+--------+ +-------------------------------------+ +----------+-------------------------+"
|
||||||
|
echo "| Terrain de | |"
|
||||||
|
echo "| Basketball | |"
|
||||||
|
echo "| | |"
|
||||||
|
echo "| ___________ | |"
|
||||||
|
echo "| / \\ | |"
|
||||||
|
echo "| / \\ | |"
|
||||||
|
echo "| | | | |"
|
||||||
|
echo "| | | | |"
|
||||||
|
echo "| | | | |"
|
||||||
|
echo "| | | | |"
|
||||||
|
echo "| | | | |"
|
||||||
|
echo "| | | | |"
|
||||||
|
echo "| | | | |"
|
||||||
|
echo "| \\ / | |"
|
||||||
|
echo "| \\___________/ | |"
|
||||||
|
echo "| | |"
|
||||||
|
echo "+-------------------------------------------+ |"
|
||||||
|
echo "| "Coin fumeur" |"
|
||||||
|
echo "+----------------------------------------------------------+"
|
||||||
|
# À la fin de map.sh
|
||||||
|
echo "Appuyez sur Enter pour revenir au menu principal."
|
||||||
|
read -s -n 1 # Attendre que l'utilisateur appuie sur une touche
|
87
adventure/games/cyril.marty@ynov.com/rooms/start.sh
Executable file
@ -0,0 +1,87 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
clear
|
||||||
|
#récupérer la varible nom
|
||||||
|
nom="$1"
|
||||||
|
|
||||||
|
# Afficher dynamiquement les informations du personnage à chaque fois que le menu s'affiche
|
||||||
|
cat "personnages/$nom/$nom.txt"
|
||||||
|
echo "-----------------------"
|
||||||
|
cat "personnages/$nom/$nom-fichier_stats.txt"
|
||||||
|
echo "-----------------------"
|
||||||
|
|
||||||
|
# Menu principal
|
||||||
|
while true; do
|
||||||
|
clear
|
||||||
|
echo "--------------------------------------------------------------------------------"
|
||||||
|
echo " Menu Principal "
|
||||||
|
echo "--------------------------------------------------------------------------------"
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo " ___ "
|
||||||
|
echo " |___|____ "
|
||||||
|
echo " / \\ "
|
||||||
|
echo " | () () | "
|
||||||
|
echo " \\ ^ / "
|
||||||
|
echo " ||||| "
|
||||||
|
echo " /|||||\ "
|
||||||
|
echo " \|||||/ "
|
||||||
|
echo " ||||| "
|
||||||
|
echo " ||||| "
|
||||||
|
echo " /_\ /_\ "
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo "1. Ouvrir le Sac 4. Regarder"
|
||||||
|
echo "2. Ouvrir la carte 5. Agir"
|
||||||
|
echo "3. Ouvir son portmonnaie 6. Se déplacer"
|
||||||
|
echo " "
|
||||||
|
echo " 7. Quitter le jeu"
|
||||||
|
echo " FDP"
|
||||||
|
echo ""
|
||||||
|
echo "--------------------------------------------------------------------------------"
|
||||||
|
echo " "
|
||||||
|
echo "--------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
read -p "Choisissez une option (1/2/3/4/5/6/7) : " choix
|
||||||
|
|
||||||
|
case $choix in
|
||||||
|
1)
|
||||||
|
# Insérez ici le code pour ouvrir le sac
|
||||||
|
echo "Le sac n'est pas encore implémenté."
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
# Insérez ici le code pour ouvrir la carte
|
||||||
|
if [ -f "map.sh" ]; then
|
||||||
|
./map.sh # Exécuter le script si présent
|
||||||
|
else
|
||||||
|
echo "La carte n'est pas encore implémentée."
|
||||||
|
fi # Fin du bloc if
|
||||||
|
;; # Fin de l'option 4
|
||||||
|
3)
|
||||||
|
cat "personnages/$nom/$nom-inventaire.txt"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
afficher_statistiques_personnage
|
||||||
|
;;
|
||||||
|
|
||||||
|
5)
|
||||||
|
cat "personnages/$nom/$nom-inventaire.txt"
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
afficher_statistiques_personnage
|
||||||
|
;;
|
||||||
|
|
||||||
|
7)
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Option invalide. Veuillez choisir une option valide."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
79
adventure/games/damien.espenel@ynov.com/README
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# SCRIPT01.CYBSEC
|
||||||
|
|
||||||
|
Master Guesser
|
||||||
|
|
||||||
|
+ 15 : game engine
|
||||||
|
-2 : multigame compatibility
|
||||||
|
+1 : shellcheck
|
||||||
|
|
||||||
|
> final 14
|
||||||
|
|
||||||
|
## "GameShell" LEVEL ?
|
||||||
|
|
||||||
|
|
||||||
|
## DIFFs
|
||||||
|
``
|
||||||
|
diff --recursive --brief ./ ../_votre\ jeu/
|
||||||
|
|
||||||
|
|
||||||
|
Seulement dans ../_votre jeu/: adventure.sh
|
||||||
|
Seulement dans ./logic: leverlogic2.ben
|
||||||
|
Seulement dans ./logic: leverlogic2.ben=
|
||||||
|
Les fichiers ./logic/leverlogic.ben et ../_votre jeu/logic/leverlogic.ben sont différents
|
||||||
|
Seulement dans ./logic: leverlogic.ben=
|
||||||
|
Seulement dans ./logic: stationlogic2.ben
|
||||||
|
Seulement dans ./: masterguesser.sh
|
||||||
|
Seulement dans ./: music
|
||||||
|
Seulement dans ./: README
|
||||||
|
Les fichiers ./rooms/end.sh et ../_votre jeu/rooms/end.sh sont différents
|
||||||
|
Les fichiers ./rooms/gameroom.sh et ../_votre jeu/rooms/gameroom.sh sont différents
|
||||||
|
Seulement dans ./rooms: kroo3.sh
|
||||||
|
Les fichiers ./rooms/mainroom.sh et ../_votre jeu/rooms/mainroom.sh sont différents
|
||||||
|
Les fichiers ./rooms/start.sh et ../_votre jeu/rooms/start.sh sont différents
|
||||||
|
Les fichiers ./rooms/white.sh et ../_votre jeu/rooms/white.sh sont différents
|
||||||
|
Seulement dans ../_votre jeu/: script
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Test
|
||||||
|
|
||||||
|
```
|
||||||
|
> d
|
||||||
|
Vous récupérez un écran portatif interactif par terre.
|
||||||
|
Appuyez sur Entrée pour continuer...
|
||||||
|
|
||||||
|
./start.sh: ligne 62: ./riddle.sh: Aucun fichier ou dossier de ce type
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
mv mastergusser.sh rooms/riddle.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
./riddle.sh: ligne 20 : kill: (88137) - Aucun processus de ce type
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
mplayerrunning=$(ps axf --sort=+utime | grep -w 'mplayer' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||||
|
[[ $mplayerrunning ]] && kill $mplayerrunning
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
shellcheck rooms/riddle.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
OK
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Created by Damien Espenel
|
||||||
|
|
||||||
|
mail : damien.espenel@ynov.com
|
||||||
|
|
||||||
|
dépendance : mplayer (installé par le script d'installation)
|
||||||
|
|
||||||
|
jeux :
|
||||||
|
- masterguesser - génère un nombre aléatoire entre 1 et 100, le joueur doit trouver ce nombre, aucune limite de tentative, s'arrête après que le joueur ait trouvé le nombre.
|
||||||
|
|
||||||
|
|
21
adventure/games/damien.espenel@ynov.com/art/Gune.ben
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
.';:llllc;'.
|
||||||
|
.:xXWX;.,ll;.:XWXx;.
|
||||||
|
;0MMMMMMKl;'',l0MMMMMWO,
|
||||||
|
,0MMMMMMW0dc;,,;cd0WMMMMMMO.
|
||||||
|
dWMMMMM0; ;OMMMMMN:
|
||||||
|
dMMMMMN: .,'. cWMMMMMc
|
||||||
|
,WMMMMX. .xNMMMMNx,'lONMMMMMMN.
|
||||||
|
oMMMMM: :WMMMMMMMMMMMMMMMMMMMMc
|
||||||
|
xMMMMM' xMMMMMMOlllllllloNMMMMo
|
||||||
|
oMMMMMc ,NMMMMMWd. KMMMM:
|
||||||
|
.WMMMMN, .l0NWWWKc KMMMX.
|
||||||
|
cMMMMMWo .. KMMW;
|
||||||
|
cWMMMMMXo' .lKd. KMK'
|
||||||
|
.xWMMMMMMN0dlllldONMMMMWOXd
|
||||||
|
.xNMMMMMMMd''lWMMMMMMXo.
|
||||||
|
'lONWMW, .XMWXOl.
|
||||||
|
..,,..,,..
|
||||||
|
|
||||||
|
|
21
adventure/games/damien.espenel@ynov.com/art/astrologo.ben
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
.':cdxxxxxoc;.
|
||||||
|
.:x00dc;'..:..,:lk00o'
|
||||||
|
;0Xd, oMo :OXx.
|
||||||
|
:KK; cMMMl .oNk.
|
||||||
|
.kN: ;MMMMMc xNl
|
||||||
|
.0K. ,WMMMMMW; ;Wo
|
||||||
|
OX. ,WMMMMMMMW; ;Wc
|
||||||
|
cM; .WMMMMMMMMMW, kX.
|
||||||
|
OX .NMMMMMMMMMMMW' ,Mc
|
||||||
|
O0 .NMMMMMMMMMMMMMW' .Mc
|
||||||
|
ON .XMMMMM0kkkkKMMMMN. ,M:
|
||||||
|
:M; KMMMMM: .,,;dMMMMMN. kX.
|
||||||
|
ON. 0MMMMMl ,WMMMMMMMMMMX. ;Wc
|
||||||
|
.0K. 0MMMMMd 'WMMMMMMMMMMMMX. :Wo
|
||||||
|
.xN: kMMMMMO .XWWWWNNNNNXXKKKd xNc
|
||||||
|
;0Xl. .oXx.
|
||||||
|
,OXx, .cOKd.
|
||||||
|
;d00xl:,....';coO0Ol'
|
||||||
|
.;:odddddl:,.
|
||||||
|
|