-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·42 lines (34 loc) · 806 Bytes
/
init.sh
File metadata and controls
executable file
·42 lines (34 loc) · 806 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
37
38
39
40
41
42
#!/bin/bash
update_file() {
set +x # remove option temporarily
diff $1 $2 >/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
echo "Updating $2"
cp $1 $2
set -x
return 0
else
echo "Skip $2"
set -x
return 1
fi
}
if [ "$EUID" -ne 0 ]; then # check sudo
echo "Please run as root"
exit 1
fi
set -eux
cd $(dirname $0)
(
su isucon bash -c "source ~/.profile; cd ~/git/isucon7final/webapp/go; make ensure; make"
)
rsync -av webapp/go/ ~/webapp/go/
rsync -av etc/nginx/ /etc/nginx/
#rsync -av etc/mysql/ /etc/mysql/
#rsync -av etc/sysctl.conf /etc/
#rsync -av etc/security/ /etc/security/
rm -rf /var/log/nginx/main_access.log
service nginx restart
systemctl restart cco.golang.service
# time curl localhost/initialize