From c695f116bb6ffdd56f5eea080f4f55c36bc35e21 Mon Sep 17 00:00:00 2001 From: qo-op Date: Tue, 6 Apr 2021 01:38:06 +0200 Subject: [PATCH] reglages --- zen/wordpress_channel.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/zen/wordpress_channel.sh b/zen/wordpress_channel.sh index d998e06..e2bfcbc 100755 --- a/zen/wordpress_channel.sh +++ b/zen/wordpress_channel.sh @@ -26,16 +26,17 @@ do if [[ -f $wpcall/do ]]; then istodo=$(cat "$wpcall/do") && echo "istodo=$istodo" istodoswarm=$(ipfs cat /ipns/$ipfnodesource/.$ipfnodesource/astroport/wordpress/$mediakey/do) && echo "istodoswarm=$istodoswarm" + [[ "$istodo" != "$istodoswarm" && "$istodoswarm" != "" ]] && itodo="$istodoswarm" isdone=$(cat "$wpcall/done") && echo "isdone=$isdone" - isdoneswarm=$(ipfs cat /ipns/$ipfnodesource/.$ipfnodesource/astroport/wordpress/$mediakey/done) && echo "isdoneswarm=$isdoneswarm" + isdoneswarm=$(ipfs cat /ipns/$istodo/.$ipfnodesource/astroport/wordpress/$mediakey/done) && echo "isdoneswarm=$isdoneswarm" + [[ "$isdone" != "$isdoneswarm" && "$isdoneswarm" != "" ]] && isdone="$isdoneswarm" + else + continue fi - + echo "istodo=$istodo isdone=$isdone" 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 "DONE not TODO. removing done" && 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 @@ -46,24 +47,27 @@ 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/ isWPuser=$(wp user list | grep "$xzuid") - wp post create --post_author="$xzuid" --post_content="

$title

" --post_title="$title" --post_excerpt="$g1pubsource" --tags_input="$genres" --porcelain + wp post create --post_author="$xzuid" --post_content="

$title

" --post_title="$title" --post_excerpt="$g1pubsource" --post_category="105" --tags_input="$genres" --porcelain # 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 + echo "$IPFSNODEID" > $responsedir/done fi else echo '## I am the source of that "done" wpcall remove "do"' - [[ $isdone ]] && echo "DONE! Removing my do" && rm -f ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/do + [[ $isdone ]] && echo "DONE! Removing my do" && rm -f ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/do* fi +## I am the destination of that "done / not todo" wpcall +[[ "$isdone" == "$IPFSNODEID" && ! $istodo ]] && echo "DONE not TODO. removing done" && rm -f ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/do* + done # REFRESH IPNS SELF PUBLISH