Skip to content

Commit

Permalink
Transfer a file to your server
Browse files Browse the repository at this point in the history
  • Loading branch information
the1Riddle committed Dec 4, 2023
1 parent e407822 commit 0387373
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 0x0C-web_server/0-transfer_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Bash script that transfers a file from our client to a server:
if [ "$#" -lt 3 ]
then
echo "Usage: 0-transfer_file PATH_TO_FILE IP USERNAME PATH_TO_SSH_KEY"
elif [ "$#" -eq 3 ]
then
scp -o StrictHostKeyChecking=no "$1" "$3@$2:~/"
else
scp -o StrictHostKeyChecking=no -i "$4" "$1" "$3@$2:~/"
fi

0 comments on commit 0387373

Please sign in to comment.