Created
June 14, 2018 17:52
-
-
Save Stebalien/ef2bc2b1261d27d91782b456c24ab575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pin () { | |
ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ | |
REFS=($@) | |
if ! test -t 0 | |
then | |
while read line | |
do | |
REFS+=("$line") | |
done | |
fi | |
local total=$(ipfs refs -r ${REFS[@]} | wc -l) | |
local count=0 | |
ipfs --api /ip4/104.131.131.82/tcp/8080 refs -r ${REFS[@]} | while read ref | |
do | |
let count++ | |
printf "[%0${#total}d/%d] %s\n" "$count" "$total" "$ref" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment