forked from STI/Astroport.ONE
verify 'ipfs cat' file exist & not empty
This commit is contained in:
parent
9e7d427774
commit
174be0eeec
|
@ -38,7 +38,7 @@ mkdir -p ~/.zen/tmp/TW
|
||||||
rm -f ~/.zen/tmp/TW/index.html
|
rm -f ~/.zen/tmp/TW/index.html
|
||||||
ipfs --timeout 6s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/TW/index.html
|
ipfs --timeout 6s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/TW/index.html
|
||||||
|
|
||||||
if [ ! -f ~/.zen/tmp/TW/index.html ]; then
|
if [ ! -s ~/.zen/tmp/TW/index.html ]; then
|
||||||
echo "ERROR IPNS TIMEOUT. Restoring local backup..."
|
echo "ERROR IPNS TIMEOUT. Restoring local backup..."
|
||||||
TW=$(ipfs add -rHq ~/.zen/game/players/$PLAYER/ipfs/moa/index.html | tail -n 1)
|
TW=$(ipfs add -rHq ~/.zen/game/players/$PLAYER/ipfs/moa/index.html | tail -n 1)
|
||||||
ipfs name publish --key=$PLAYER /ipfs/$TW
|
ipfs name publish --key=$PLAYER /ipfs/$TW
|
||||||
|
@ -111,7 +111,7 @@ do
|
||||||
--import ~/.zen/Astroport.ONE/templates/data/local.api.json "application/json" \
|
--import ~/.zen/Astroport.ONE/templates/data/local.api.json "application/json" \
|
||||||
--import ~/.zen/Astroport.ONE/templates/data/local.gw.json "application/json" \
|
--import ~/.zen/Astroport.ONE/templates/data/local.gw.json "application/json" \
|
||||||
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
||||||
[[ -f ~/.zen/tmp/newindex.html ]] && cp ~/.zen/tmp/newindex.html ~/.zen/game/world/$WISHKEY/index.html
|
[[ -s ~/.zen/tmp/newindex.html ]] && cp ~/.zen/tmp/newindex.html ~/.zen/game/world/$WISHKEY/index.html
|
||||||
|
|
||||||
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://127.0.0.1:8080", "http://astroport", "https://astroport.com", "https://qo-op.com", "https://tube.copylaradio.com", "http://'$(hostname)'.local:8080" ]'
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://127.0.0.1:8080", "http://astroport", "https://astroport.com", "https://qo-op.com", "https://tube.copylaradio.com", "http://'$(hostname)'.local:8080" ]'
|
||||||
## RESTART IPFS !?
|
## RESTART IPFS !?
|
||||||
|
@ -186,7 +186,7 @@ convert -gravity northwest -pointsize 50 -fill black -draw "text 30,300 \"Ğ1 VO
|
||||||
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
||||||
|
|
||||||
echo "PLAYER TW Update..."
|
echo "PLAYER TW Update..."
|
||||||
if [[ -f ~/.zen/tmp/newindex.html ]]; then
|
if [[ -s ~/.zen/tmp/newindex.html ]]; then
|
||||||
echo "Mise à jour ~/.zen/game/players/$PLAYER/ipfs/moa/index.html"
|
echo "Mise à jour ~/.zen/game/players/$PLAYER/ipfs/moa/index.html"
|
||||||
cp -f ~/.zen/tmp/newindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
cp -f ~/.zen/tmp/newindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
||||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
|
|
|
@ -31,7 +31,8 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
|
||||||
ipfs key list -l | grep -w $GNS
|
ipfs key list -l | grep -w $GNS
|
||||||
ipfs key list -l | grep -w $GNS | wc -l
|
ipfs key list -l | grep -w $GNS | wc -l
|
||||||
|
|
||||||
if [ ! -f ~/.zen/tmp/TW/index.html ]; then
|
if [ ! -s ~/.zen/tmp/TW/index.html ]; then
|
||||||
|
rm -f ~/.zen/tmp/TW/index.html
|
||||||
echo "Aucun ancien TW détecté! Appuyez sur ENTRER pour créer un nouveau TW Astronaute"
|
echo "Aucun ancien TW détecté! Appuyez sur ENTRER pour créer un nouveau TW Astronaute"
|
||||||
read
|
read
|
||||||
else
|
else
|
||||||
|
|
|
@ -77,7 +77,7 @@ for PLAYER in $(ls ~/.zen/game/players/); do
|
||||||
mkdir -p ~/.zen/tmp/astro
|
mkdir -p ~/.zen/tmp/astro
|
||||||
ipfs --timeout 12s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/astro/index.html
|
ipfs --timeout 12s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/astro/index.html
|
||||||
|
|
||||||
if [ ! -f ~/.zen/tmp/astro/index.html ]; then
|
if [ ! -s ~/.zen/tmp/astro/index.html ]; then
|
||||||
echo "ERROR IPNS TIMEOUT. Using local backup..."
|
echo "ERROR IPNS TIMEOUT. Using local backup..."
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue