-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathteam28.sh
More file actions
40 lines (38 loc) · 1.04 KB
/
team28.sh
File metadata and controls
40 lines (38 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#script to transfer file/dir from a server to the other
# Group31 script
#note: change your .pem permission to 400 using chmod. eg sudo chmod 400 .pem
#!/bin/bash
echo "are you transfering a file:y/n?"
read filetype
echo "are you using a key or password:key/password"
read keytype
if [ $filetype == y ] && [ $keytype == key ]
then
echo "Please type in the file to transfer"
read file
echo "please type in the destination private IP address"
read IP
echo "please type in the target destination"
read dest
echo "username"
read username
echo "please type in your destination server .pem key"
read key
#note: your .pem must be saved locally on the source server
echo `scp -i $key $file $username@$IP:$dest`
elif [ $filetype == y ] && [ $keytype == password ]
then
echo "Please type in the file to transfer"
read file
echo "please type in the destination private IP address"
read IP
echo "please type in the target destination"
read dest
echo "username"
read username
echo `scp $file $username@$IP:$dest`
#echo "password"
#read -s $password
else
echo "move on please"
fi