Last active
August 29, 2015 14:10
-
-
Save johntyree/7322d80e6b2a03ab3aea 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
#! /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