forked from Group32DevOps/group31
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteam28.sh
More file actions
37 lines (35 loc) · 954 Bytes
/
team28.sh
File metadata and controls
37 lines (35 loc) · 954 Bytes
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
#script to transfer file/dir from a server to the other
# Group28 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 `scp -i tomcatkey.pem $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