From 27f780425a953e115546300ad81301041823d765 Mon Sep 17 00:00:00 2001 From: qo-op Date: Thu, 17 Jun 2021 23:41:27 +0200 Subject: [PATCH] KEYFILE debug --- zen/tools/autoPINfriends.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/zen/tools/autoPINfriends.sh b/zen/tools/autoPINfriends.sh index 1bcb4f9..4b8af4b 100755 --- a/zen/tools/autoPINfriends.sh +++ b/zen/tools/autoPINfriends.sh @@ -44,15 +44,8 @@ do if [[ -f $HOME/.zen/ipfs_swarm/.${ipfsnodesource}/KEY/${mediakey}/${g1source}/${G1PUB}/.ipns.mediakey.encrypt ]]; then $MY_PATH/natools.py decrypt -f pubsec -k "$HOME/.zen/secret.dunikey" -i "$HOME/.zen/ipfs_swarm/.${ipfsnodesource}/KEY/${mediakey}/${g1source}/${G1PUB}/.ipns.mediakey.encrypt" -o "/tmp/ipns.mediakey" if [[ -f /tmp/ipns.mediakey ]]; then - ## FIND ipns key file name - KEYFILE=$(ipfs key list | grep "${mediakey}") ## BUG !! THIS IS NOT FILE NAME !! - if [[ ! $KEYFILE ]]; then - KEY=$(ipfs key gen "${mediakey}") - KEYFILE=$(ls -t ~/.ipfs/keystore/ | head -n 1) - fi - ## REPLACE with GOOD MEDIAKEY FILE into ~/.ipfs/keystore/ - rm -f ~/.ipfs/keystore/$KEYFILE - mv /tmp/ipns.mediakey ~/.ipfs/keystore/$KEYFILE + KEYFILE=$($MY_PATH/give_me_keystore_filename.py "${mediakey}") + [[ ! -f ~/.ipfs/keystore/$KEYFILE ]] && mv /tmp/ipns.mediakey ~/.ipfs/keystore/$KEYFILE || echo "KEYSTORE EXISTING. EXIT" && continue echo "${mediakey}" > ~/.zen/PIN/${astrofile}/MEDIAKEY echo "$(ipfs key list -l | grep ${mediakey} | cut -d ' ' -f 1)" > ~/.zen/PIN/${astrofile}/IPNSLINK fi