prevent loop from empty $mediakey

This commit is contained in:
fred 2021-08-06 15:08:26 +02:00
parent 09430a4a5c
commit 9d740d7029
1 changed files with 100 additions and 98 deletions

View File

@ -65,8 +65,10 @@ count=0
## TAKE CARE OF MY KEY
for mediakey in $(ls ~/.zen/ipfs/.${IPFSNODEID}/KEY/); # Alternative search
do
count=$((count+1)) && echo "$count) "
[[ "${mediakey}" == "" ]] && continue ## prevent empty mediakey
IPNSLINK=$(ipfs key list -l | grep ${mediakey} | cut -d ' ' -f 1)
[[ "${IPNSLINK}" == "" ]] && continue ## prevent empty IPNSLINK
count=$((count+1)) && echo "$count) "
FILE_NAME=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.ipfs.filename)
TITLE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.title)