-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·50 lines (32 loc) · 1.38 KB
/
setup.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
echo "This wizard will run you through the setup of the bullet-time node server"
echo "What is the ID of this node (101 - 150)"
read nodeNum
echo ""
echo "============ System Configuration (10.0.0.$nodeNum) ============"
echo ""
echo "Updating system"
sudo apt-get update -y && sudo apt-get upgrade -y
sudo hostnamectl set-hostname btns-node-$nodeNum
echo "127.0.1.1 btns-node-$nodeNum" | tee /etc/hosts
echo "127.0.0.1 localhost" | tee -a /etc/hosts
echo "::1 localhost ip6-localhost ip6-loopback" | tee -a /etc/hosts
echo "ff02::1 ip6-allnodes" | tee -a /etc/hosts
echo "ff02::2 ip6-allrouters" | tee -a /etc/hosts
echo "Hostname set to btns-node-$nodeNum"
mkdir -p /etc/network/interfaces.d
echo ""
echo "Configuring Static IP Address:"
echo "" | sudo tee /etc/network/interfaces.d/eth0
echo "allow-hotplug eth0" | sudo tee -a /etc/network/interfaces.d/eth0
echo "iface eth0 inet static" | sudo tee -a /etc/network/interfaces.d/eth0
echo "address 10.0.0.$nodeNum" | sudo tee -a /etc/network/interfaces.d/eth0
echo "network 10.0.0.0/24" | sudo tee -a /etc/network/interfaces.d/eth0
echo "netmask 255.255.255.0" | sudo tee -a /etc/network/interfaces.d/eth0
echo "gateway 10.0.0.1" | sudo tee -a /etc/network/interfaces.d/eth0
echo ""
echo "Static IP Set"
echo ""
sudo chmod +x ./install.sh
sudo chmod +x ./update.sh
./install.sh
sudo reboot now