Skip to content

Instantly share code, notes, and snippets.

@rkfg
Last active October 26, 2015 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkfg/d33301fef66584347f91 to your computer and use it in GitHub Desktop.
Save rkfg/d33301fef66584347f91 to your computer and use it in GitHub Desktop.
ipfs.pics uploader
#!/bin/sh
FLAGS=
PICSPATH=
PREFIX=http://ipfs.pics/
if [ -d "$1" ]
then
FLAGS=-r
else
PICSPATH=ipfs/
fi
if [ -n "$2" ]
then
PREFIX="$2"
fi
HASH=$(ipfs add -q $FLAGS "$1" | tail -n1)
URL=$PREFIX$PICSPATH$HASH
echo $URL
echo -n $URL | xsel -ib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment