astroport/zen/tools/clean_OLD_ipfs.Qm.sh

8 lines
327 B
Bash
Executable File

#!/bin/bash
## In case OLD IPFSNODEID exists (remove it)
IPFSNODEID=$(ipfs id -f='<id>\n') && [[ $IPFSNODEID == "" ]] && exit 1
for DOTQm in ~/.zen/ipfs/.12D3KooW*; do
Qm=$(echo $DOTQm | cut -d '/' -f 6 | cut -d '.' -f 2)
[[ "$Qm" != "$IPFSNODEID" && "$Qm" != "" ]] && rm -Rf $DOTQm && echo "OLD IPFS ID REMOVED"
done