-
-
Save andrewpage/5bc187e7819a9c725826 to your computer and use it in GitHub Desktop.
function to scp through a jumphost
This file contains hidden or 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
function scpt { | |
origin=$1 | |
origin_filename=$(basename $origin) | |
jumphost=$2 | |
destination=$3 | |
echo "SCPing '$origin' through jumphost '$jumphost' to destination '$destination'." | |
cat < $origin | ssh $jumphost "cat > $origin_filename && scp $origin_filename $destination && rm $origin_filename" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment