refresh last do / done ipns values

This commit is contained in:
qo-op 2021-04-05 01:51:04 +02:00
parent 8b3bf1cc59
commit 5d4ba11712
1 changed files with 3 additions and 9 deletions

View File

@ -26,21 +26,15 @@ do
g1pubsource=$($MY_PATH/tools/ipfs_to_g1.py $ipfnodesource)
mediakey=$(echo "$wpcall" | cut -d '/' -f 9 )
[[ -f $wpcall/do ]] && istodo=$(cat $wpcall/do) && echo "istodo=$istodo"
## REFRESH SWARM cache
rm -Rf $wpcall/$mediakey
[[ $istodo && "$istodo" != "1" ]] && echo "REFRESH $istodo" && $MY_PATH/tools/timeout.sh -t 12 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$istodo && istodo=$(cat ~/.zen/ipfs_swarm/.$istodo/astroport/wordpress/$mediakey/do) && echo "istodo=$istodo"
[[ "$ipfsnodeid" != "$IPFSNODEID" ]] && echo "REFRESH $ipfnodesource" && $MY_PATH/tools/timeout.sh -t 12 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfnodesource
[[ -f $wpcall/done ]] && isdone=$(cat $wpcall/done) && echo "isdone=$isdone"
[[ -f $wpcall/do ]] && istodo=$(ipfs cat /ipns/$ipfnodesource/.$ipfnodesource/astroport/wordpress/$mediakey/do) && echo "istodo=$istodo"
[[ $istodo && "$istodo" != "1" ]] && isdone=$(ipfs cat /ipns/$istodo/.$istodo/astroport/wordpress/$mediakey/done) && echo "isdone=$isdone"
[[ ! $isdone && ! $istodo ]] && continue
if [[ "$ipfsnodeid" != "$IPFSNODEID" ]]; then
[[ ! $(which wp) ]] && continue # MUST RUN WORDPRESS and wp-cli
## I am the destination of that "done / not todo" wpcall
[[ $isdone && ! $istodo ]] && echo rm -Rf ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey
[[ $isdone && ! $istodo ]] && echo "0" > ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/do
if [[ $istodo && ! $isdone ]]; then
[[ "$istodo" == "$IPFSNODEID" ]] && echo "Already DONE by $istodo" && continue