-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprovision.sh
79 lines (64 loc) · 1.71 KB
/
provision.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
echo "
########################################################################
_
_ __ ___| | ___ __
| '_ \|_ / |/ / '_ \
| | | |/ /| <| |_) |
|_| |_/___|_|\_\ .__/
|_|
Andrew Duncan <[email protected]>
########################################################################
"
# Update and upgrade
echo "Updating system..."
apt-get update > /dev/null 2>&1
echo "Upgrading system packages..."
apt-get -y upgrade > /dev/null 2>&1
# Install system dependencies.
echo "Installing system dependencies: libgmp, m4, libsocket"
apt-get -y install libgmp3-dev happycoders-libsocket-dev m4 > /dev/null 2>&1
# Build libgmp
if [ ! -d "/home/vagrant/libgmp" ];
then
mkdir /home/vagrant/libgmp
cd /home/vagrant/libgmp
echo "Fetching libgmp from gmplib.org."
wget https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2
tar xjvf gmp-6.0.0a.tar.bz2 > /dev/null 2>&1
cd gmp-6.0.0
echo "Building libgmp."
./configure; make; make install
chown -R vagrant:vagrant /home/vagrant/libgmp
fi
if [ ! -d "/home/vagrant/nzkp" ];
then
mkdir /home/vagrant/nzkp
fi
# build zkp client
echo "Building nzkp client and server."
cd /vagrant
make
make install
make clean
# Remove previous timestamp-started file.
if [ -f /home/vagrant/started ];
then
echo "Clearing previous started file."
rm /home/vagrant/started
fi
# Create started file with timestamp.
touch /home/vagrant/started
echo "Timestamp file created under /home/vagrant/started"
if [ -d /home/vagrant/nzkp ];
then
echo "
########################################################################
Running experiment...
Just a stub for now.
"
echo "
Experiment complete.
########################################################################
"
fi