diff --git a/zen/wordpress_channel.sh b/zen/wordpress_channel.sh index 0593539..b2b1c3f 100755 --- a/zen/wordpress_channel.sh +++ b/zen/wordpress_channel.sh @@ -30,7 +30,11 @@ do 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 + if [[ $istodo && ! $isdone ]]; then + [[ "$istodo" == "$IPFSNODEID" ]] && echo "Already DONE by $istodo" && continue ## I am the destination of that "todo / not done" wpcall echo "$ipfnodesource wants to publish $mediakey" ## GET ipns link + title + xzuid @@ -39,7 +43,7 @@ do xzuid=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/_xbian.zuid) mynodename=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/G1SSB/_nodename) - genres="$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/ajouter_video.txt | cut -d ';' -f 6 | sed s/\|/,/g)" + genres="$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/ajouter_video.txt | cut -d ';' -f 6 | sed 's/\|/,/g' | awk '{print tolower($0)}' )" # 1=DIY, Habiter=2, Guerir=3, Divertir=4, Déplacer=5, Energie=6, Cultiver=7 cd /var/www/wordpress/ @@ -48,10 +52,9 @@ do # REPLY IN ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/done responsedir="$(echo "$wpcall" | sed 's/ipfs_swarm/ipfs/g')" mkdir -p $responsedir + echo "$IPFSNODEID" > $responsedir/do echo "1" > $responsedir/done fi - ## I am the destination of that "done / not todo" wpcall - [[ $isdone && ! $istodo ]] && echo rm -Rf ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey else ## I am the source of that "done" wpcall remove "do"