Skip to content

Instantly share code, notes, and snippets.

@soldev-42
Created November 3, 2015 19:08
Show Gist options
  • Select an option

  • Save soldev-42/828b0ff6d6dea3643854 to your computer and use it in GitHub Desktop.

Select an option

Save soldev-42/828b0ff6d6dea3643854 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -d $1 ]]; then
echo "$1 is a directory"
scp -r $1 [email protected]:/home/user/folderToUploadTo
elif [[ -f $1 ]]; then
echo "$1 is a file"
scp $1 [email protected]:/home/user/folderToUploadTo
else
echo "error $1 is not valid"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment