Skip to content

Instantly share code, notes, and snippets.

@payload
Forked from astro/share.sh
Created January 26, 2012 23:46
Show Gist options
  • Save payload/1685893 to your computer and use it in GitHub Desktop.
Save payload/1685893 to your computer and use it in GitHub Desktop.
Quick Sharing On The Local Chaos Bay
#!/bin/bash -e
URL=http://chaosbay.hq.c3d2.de
if [ -z "$1" ]; then
echo "Usage: $0 <file/dir>"
exit 2
fi
if [ -x "$(which mktorrent)" ]; then
mktorrent -a $URL/announce "$1"
elif [ -x "$(which buildtorrent)" ]; then
buildtorrent -a $URL/announce "$1" "$1.torrent"
elif [ -x "$(which createtorrent)" ]; then
echo "createtorrent? srsly?"
elif [ -x "$(which transmission-remote)" ]; then
echo "transmission-remote? srsly?"
else
echo "nothing? srsly?"
fi
curl -X POST -F "file=@$1.torrent" $URL/add
rtorrent "$1.torrent"
# transmission-gtk? ...?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment