Last active
December 12, 2015 10:29
-
-
Save gfixler/4759877 to your computer and use it in GitHub Desktop.
Gnome Nautilus script to zip/scp files to server.
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 | |
# zip/scp selected file(s) to server; copy URL to X clipboard | |
# put in ~/.gnome2/nautilus | |
# Put these 4 lines in ~/.sendit: | |
# SENDIT_USER='username' # your scp login | |
# SENDIT_SITE='yoursite.com' # site to scp to | |
# SENDIT_PATH='website/path' # where to 'sendit' | |
# SENDIT_LINK='http://www.yoursite.com/path' # for copying URL | |
. ~/.sendit | |
zipname=`zenity --entry --title "SendIt" --text "zip file name"`".zip" | |
cd $NAUTILUS_SCRIPT_CURRENT_URI | |
echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | sed 's/\S*\///g' | \ | |
xargs zip -r /tmp/$zipname | |
scp "/tmp/$zipname" "$SENDIT_USER@$SENDIT_SITE:$SENDIT_PATH/$zipname" | |
echo "$SENDIT_LINK/$zipname" | xclip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment