Skip to content

Instantly share code, notes, and snippets.

@johntyree
Last active August 29, 2015 14:10
Show Gist options
  • Save johntyree/7322d80e6b2a03ab3aea to your computer and use it in GitHub Desktop.
Save johntyree/7322d80e6b2a03ab3aea to your computer and use it in GitHub Desktop.
#! /bin/bash
USER=tyree
FTPPASS=
HOST=john.bitsurge.net
SUBDIR="public"
if [[ "$1" == "-p" ]]; then
shift
SUBDIR="private"
fi
TARGET="john.bitsurge.net/$SUBDIR"
pastestring="http://$HOST/$SUBDIR/"
if [[ "$@" == "$1" ]]; then
pastestring=$(sed s/" "/%20/g <<< ${pastestring}"$(basename "$1")")
fi
echo $pastestring
echo -n "$pastestring" | xclip -selection clipboard -loops 10 &>/dev/null || echo "xclip failed."
echo rsync -avthP "$@" "$USER@$HOST:$TARGET/"
rsync -avthP "$@" "$USER@$HOST:$TARGET/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment