Created
October 16, 2011 15:44
-
-
Save forresty/1291057 to your computer and use it in GitHub Desktop.
rwget: wget through ssh tunnel
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
#!/usr/bin/env sh | |
# TODO: replace your-hostname-here.com and path_to_your_rwget_folder | |
if [ $# -lt 1 ] ; then | |
echo "usage: rwget URL" | |
exit 1 | |
fi | |
filename=`ssh your-hostname-here.com URL=$1 'bash -s' << 'ENDSSH' | |
cd path_to_your_rwget_folder | |
wget -q --no-use-server-timestamps $URL | |
ls -t | head -n 1 | |
ENDSSH` | |
scp your-hostname-here.com:/path_to_your_rwget_folder/${filename} . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment