astroport/zen/tools/clean_OLD_ipfs.Qm.sh

8 lines
327 B
Bash
Raw Normal View History

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