Created
December 15, 2020 19:01
-
-
Save kushal-r/a433ac713401263adae699015dd6d5b7 to your computer and use it in GitHub Desktop.
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
| gen_remote_host() { | |
| case $1 in | |
| "thor") r_host="10.189.50.0" | |
| user_name="thor" | |
| ;; | |
| "loki") r_host="10.189.16.251" | |
| user_name="loki" | |
| ;; | |
| esac | |
| } | |
| cp2 () { | |
| local r_host user_name | |
| local src dest | |
| src=$2 | |
| if [[ -z "$3" ]]; | |
| then dest="~/" | |
| else dest=$3 | |
| fi | |
| gen_remote_host $1 | |
| echo scp "$src" "$user_name"@"$r_host":"$dest" | |
| scp "$src" "$user_name"@"$r_host":"$dest" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment