Skip to content

Instantly share code, notes, and snippets.

@dylangerdaly
Created November 4, 2018 11:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylangerdaly/2f8c14141bb00e4d018695ff62530d06 to your computer and use it in GitHub Desktop.
Save dylangerdaly/2f8c14141bb00e4d018695ff62530d06 to your computer and use it in GitHub Desktop.
#!/bin/bash
for file in $(./ipfs refs local);
do
if ! [[ $(./ipfs cat "$file" 2>&1 >/dev/null | grep 'Error') ]] ; then
if ! [[ $(./ipfs cat "$file" | file - | grep ': data') ]] ; then
printf "=== LOCAL FILE FOUND ===\n\n"
echo $file
./ipfs cat "$file" | file -
printf "\n\n"
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment