-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildCDN
executable file
·59 lines (49 loc) · 1.23 KB
/
buildCDN
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
while getopts 'p:o:n:u:i:' OPTION; do
case "$OPTION" in
p)
port=${OPTARG}
;;
o)
origin=${OPTARG}
;;
i)
keyfile=${OPTARG}
;;
n)
servername=${OPTARG}
;;
u)
username=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
make clean
# DNS
rsync -a --exclude=".*" -e "ssh -i $keyfile" ./DNS $username@97.107.140.73:~
rsync -a --exclude=".*" -e "ssh -i $keyfile" ./JSON $username@97.107.140.73:~
scp -i $keyfile Makefile $username@97.107.140.73:~
ssh -o StrictHostKeyChecking=no -i $keyfile $username@97.107.140.73 <<EOF
make clean
make dnsserver
exit
EOF
scp -o StrictHostKeyChecking=no -i $keyfile $username@97.107.140.73:DNS/dnsserver ./DNS
ssh -i $keyfile $username@97.107.140.73 <<EOF
rm -r *
exit
EOF
#HTTP
rsync -a --exclude=".*" -e "ssh -o StrictHostKeyChecking=no -i $keyfile" ./HTTP $username@173.255.210.124:~
ssh -i $keyfile $username@173.255.210.124 <<EOF
cd HTTP
make -f HTTP.mk clean
make -f HTTP.mk
exit
EOF
scp -o StrictHostKeyChecking=no -i $keyfile $username@173.255.210.124:HTTP/httpserver ./HTTP
ssh -i $keyfile $username@173.255.210.124 <<EOF
rm -r *
exit
EOF