lazy-code/bash/scp-dir.sh
2024-07-03 21:06:41 +02:00

10 lines
332 B
Bash

#!/usr/bin/env bash
# Store destination paths in variables
nasty="eplots@192.168.50.212:~/NASty/hackz"
# Parse directory path to get directory name only and store it in a variable
dir="$(basename $2)"
# If $1 variable equals "NASty", format SCP to copy dir ($2) to NASty:
[ "$1" == nasty ] && scp -P 1886 -r "$2" "$nasty"/"$dir"