diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index dac854c..0537fb2 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -203,7 +203,7 @@ fi [[ $(($runtime % 370)) == 0 || "$runtime" == "10" ]] && $MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt # SYNC IPFS FRIENDS SWARM -if [[ $(($runtime % 30)) == 0 ]]; then +if [[ $(($runtime % 25)) == 0 ]]; then kill -9 $(ps auxf --sort=+utime | grep -w p4n.swarmscraper.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') killall chromium $MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt @@ -242,7 +242,7 @@ fi # /___/\___/_/ /_/ /_/ /_/ |_\____/ # # REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle -if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || "$timebar" == "03:03" || $(($runtime % 720)) == 0 || $runtime == 12 ]]; then +if [[ $(($runtime % 7)) == 0 ]]; then #### Refresh & publish MEDIAKEYs $MY_PATH/zen/ipns_TAG_refresh.sh diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index 4f79886..f915d5f 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -7,6 +7,8 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" +countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) +[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 ######################################################################## # \\/// @@ -27,8 +29,8 @@ IPFSNODEID=$(ipfs --timeout=20s id -f='\n') G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) ######################################################################## -echo "## FRIENDS IPFS PINGing" -for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=3s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done +# echo "## FRIENDS IPFS PINGing" +# for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=3s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done echo " @@ -43,14 +45,14 @@ echo "I am /ipns/$IPFSNODEID controling and refreshing my MEDIAKEY IPNS" ######################################################################## # REFRESH IPNS SELF PUBLISH ######################################################################## -~/.zen/astrXbian/zen/ipns_self_publish.sh +# ~/.zen/astrXbian/zen/ipns_self_publish.sh ######################################################################## count=0 [[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/KEY/ ]] && exit 0 ## TAKE CARE OF MY KEY -for mediakey in $(ls ~/.zen/ipfs/.${IPFSNODEID}/KEY/); # Alternative search +for mediakey in $(ls ~/.zen/ipfs/.${IPFSNODEID}/KEY/ | shuf); # Alternative search do [[ "${mediakey}" == "" ]] && continue ## prevent empty mediakey # [[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0 @@ -100,7 +102,7 @@ do | sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${G1PUB}/$G1PUB/g" \ | sed "s/\${TITLE}/$TITLE/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html ######################################################################## ### Scenario are G1PUB subdivized. Thus each friend can establish own contract @@ -128,7 +130,7 @@ do | sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \ | sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html + > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html if [[ "$source" == "YOUTUBE" ]] @@ -177,7 +179,7 @@ do echo "$id REFRESHED https://tube.copylaradio.com/ipns/$J" ######################################################################## ######################################################################## - + break ## TODO REMOVE IF CRON 6H done ######################################################################## @@ -186,7 +188,7 @@ done ## Then refresh MEDIAKEY IPNS/IPFS RELATION ## CORRECT ISSUE : https://git.p2p.legal/axiom-team/astrXbian/issues/25 ######################################################################## -for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK); do +for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK | shuf); do ipnsid=$(cat $ipnslink) ipfsid=$(echo $ipnslink | cut -d '/' -f 6) mediakey=$(cat ~/.zen/PIN/${ipfsid}/MEDIAKEY) @@ -216,6 +218,8 @@ for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK); do ipfs name publish -k ${mediakey} --quieter /ipfs/$NEWIPFS echo "PIN PUBLISHING https://tube.copylaradio.com/ipns/$ipnsid TO /ipfs/$NEWIPFS" rm -Rf /tmp/${mediakey} + + break ## DO ONE BY ONE done ########################################################################