From c2fdfd4946205ca5323ede36b0758b14f781bffa Mon Sep 17 00:00:00 2001 From: qo-op Date: Thu, 1 Apr 2021 17:04:30 +0200 Subject: [PATCH] corrections --- zen/gchange_IPFS_swarm.sh | 5 +++-- zen/ipfs_SWARM_refresh.sh | 11 +++-------- zen/new_file_in_astroport.sh | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index c473844..7b7588c 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -7,6 +7,9 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 +G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 +IPFSNODEID=$(ipfs id -f='\n') && [[ "$IPFSNODEID" == "" ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 # CLEAN "A_my_swarm.txt" and "A_swarm_map.txt" rm -f ~/.zen/A_my_swarm.txt && touch ~/.zen/A_my_swarm.txt @@ -15,8 +18,6 @@ rm -f ~/.zen/A_swarm_map.txt && touch ~/.zen/A_swarm_map.txt ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info ######################################################################## -IPFSNODEID=$(ipfs id -f='\n') -[[ $IPFSNODEID == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1 isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) [[ ! $isIPFSRunning ]] && echo "ERROR! ipfs daemon is not running. EXIT" && exit 1 ######################################################################## diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index e79edf9..64f0a27 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -7,20 +7,15 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 +G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 +IPFSNODEID=$(ipfs id -f='\n') && [[ "$IPFSNODEID" == "" ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## -# \\/// -# qo-op -############# '$MY_PATH/$ME' -######################################################################## -# ex: ./'$ME' ######################################################################## # This script is controling IPFS swarm # Sync friends peers ~/.zen/ipfs/ into ~/.zen/ipfs_swarm/.IPFSNODEID's/ directories # add not friend_of_mine IPs to fail2ban ######################################################################## -# TODO remove because now it is in~/.bashrc -export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) -export IPFSNODEID=$(ipfs id -f='\n') && [[ ! $IPFSNODEID ]] && exit 1 ######################################################################## mkdir -p ~/.zen/ipfs_swarm echo ' diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index ce9a540..eeb66fb 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -60,7 +60,7 @@ case ${CAT} in youtube) INDEXPREFIX="YOUTUBE_" REFERENCE=$(echo "$path" | cut -d '/' -f 6 ) - TITLE=$(echo "$file" | cut -d "/" -f 2-) + TITLE="${file%.*}" ;; mp3) ## DIFFERENT TREATMENT