channel="wordpress"
This commit is contained in:
parent
ef48f249db
commit
8c533fd5ea
|
@ -15,8 +15,10 @@ IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||||
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid);
|
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid);
|
||||||
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)
|
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)
|
||||||
|
|
||||||
|
channel="$1" && [[ "$channel" == "" ]] && channel="wordpress"
|
||||||
|
|
||||||
## CREATION DE LA ZONE DE DIALOGUE IPFS SWARM
|
## CREATION DE LA ZONE DE DIALOGUE IPFS SWARM
|
||||||
for wpcall in $(ls -d ~/.zen/ipfs_swarm/.12D*/astroport/wordpress/*);
|
for wpcall in $(ls -d ~/.zen/ipfs_swarm/.12D*/astroport/${channel}/*);
|
||||||
do
|
do
|
||||||
echo "$wpcall" && ls $wpcall
|
echo "$wpcall" && ls $wpcall
|
||||||
ipfnodesource=$(echo "$wpcall" | cut -d '/' -f 6 | cut -d '.' -f 2 )
|
ipfnodesource=$(echo "$wpcall" | cut -d '/' -f 6 | cut -d '.' -f 2 )
|
||||||
|
@ -25,10 +27,10 @@ do
|
||||||
|
|
||||||
if [[ -f $wpcall/do ]]; then
|
if [[ -f $wpcall/do ]]; then
|
||||||
istodo=$(cat "$wpcall/do") && echo "istodo=$istodo"
|
istodo=$(cat "$wpcall/do") && echo "istodo=$istodo"
|
||||||
istodoswarm=$(ipfs cat /ipns/$ipfnodesource/.$ipfnodesource/astroport/wordpress/$mediakey/do) && echo "istodoswarm=$istodoswarm"
|
istodoswarm=$(ipfs cat /ipns/$ipfnodesource/.$ipfnodesource/astroport/${channel}/$mediakey/do) && echo "istodoswarm=$istodoswarm"
|
||||||
[[ "$istodo" != "$istodoswarm" && "$istodoswarm" != "" ]] && itodo="$istodoswarm"
|
[[ "$istodo" != "$istodoswarm" && "$istodoswarm" != "" ]] && itodo="$istodoswarm"
|
||||||
isdone=$(cat "$wpcall/done") && echo "isdone=$isdone"
|
isdone=$(cat "$wpcall/done") && echo "isdone=$isdone"
|
||||||
isdoneswarm=$(ipfs cat /ipns/$istodo/.$ipfnodesource/astroport/wordpress/$mediakey/done) && echo "isdoneswarm=$isdoneswarm"
|
isdoneswarm=$(ipfs cat /ipns/$istodo/.$ipfnodesource/astroport/${channel}/$mediakey/done) && echo "isdoneswarm=$isdoneswarm"
|
||||||
[[ "$isdone" != "$isdoneswarm" && "$isdoneswarm" != "" ]] && isdone="$isdoneswarm"
|
[[ "$isdone" != "$isdoneswarm" && "$isdoneswarm" != "" ]] && isdone="$isdoneswarm"
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
|
@ -68,11 +70,11 @@ do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 1=DIY, Habiter=2, Guerir=3, Divertir=4, Déplacer=5, Energie=6, Cultiver=7
|
# 1=DIY, Habiter=2, Guerir=3, Divertir=4, Déplacer=5, Energie=6, Cultiver=7
|
||||||
cd /var/www/wordpress/
|
cd /var/www/${channel}/
|
||||||
# isWPuser=$(wp user list | grep "$xzuid")
|
# isWPuser=$(wp user list | grep "$xzuid")
|
||||||
wp post create --post_author="$xzuid" --post_content="<h1><a href=\"$zurl\" target=\"_blank\" rel=\"noreferrer noopener\">$title</a></h1><p>$description</p>" --post_title="$title" --post_excerpt="$description" --post_category="105" --tags_input="$tags" --porcelain
|
wp post create --post_author="$xzuid" --post_content="<h1><a href=\"$zurl\" target=\"_blank\" rel=\"noreferrer noopener\">$title</a></h1><p>$description</p>" --post_title="$title" --post_excerpt="$description" --post_category="105" --tags_input="$tags" --porcelain
|
||||||
|
|
||||||
# REPLY IN ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/done
|
# REPLY IN ~/.zen/ipfs/.$ipfnodesource/astroport/${channel}/$mediakey/done
|
||||||
responsedir="$(echo "$wpcall" | sed 's/ipfs_swarm/ipfs/g')"
|
responsedir="$(echo "$wpcall" | sed 's/ipfs_swarm/ipfs/g')"
|
||||||
mkdir -p $responsedir
|
mkdir -p $responsedir
|
||||||
echo "$IPFSNODEID" > $responsedir/do
|
echo "$IPFSNODEID" > $responsedir/do
|
||||||
|
@ -81,11 +83,11 @@ do
|
||||||
|
|
||||||
else
|
else
|
||||||
echo '## I am the source of that "done" wpcall remove "do"'
|
echo '## I am the source of that "done" wpcall remove "do"'
|
||||||
[[ $isdone ]] && echo "DONE! Removing my do" && rm -Rf ~/.zen/ipfs/.$ipfnodesource/astroport/wordpress/$mediakey/do* && rm -f ~/.zen/ipfs_swarm/.$ipfnodesource/astroport/wordpress/$mediakey/do*
|
[[ $isdone ]] && echo "DONE! Removing my do" && rm -Rf ~/.zen/ipfs/.$ipfnodesource/astroport/${channel}/$mediakey/do* && rm -f ~/.zen/ipfs_swarm/.$ipfnodesource/astroport/${channel}/$mediakey/do*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## I am the destination of that "done / not todo" wpcall
|
## 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* && rm -f ~/.zen/ipfs_swarm/.$ipfnodesource/astroport/wordpress/$mediakey/do*
|
[[ "$isdone" == "$IPFSNODEID" && ! $istodo ]] && echo "DONE not TODO. removing done" && rm -f ~/.zen/ipfs/.$ipfnodesource/astroport/${channel}/$mediakey/do* && rm -f ~/.zen/ipfs_swarm/.$ipfnodesource/astroport/${channel}/$mediakey/do*
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue