-
Notifications
You must be signed in to change notification settings - Fork 15
/
install.site
executable file
·50 lines (43 loc) · 1.52 KB
/
install.site
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
#!/bin/sh
# Install python2
export PKG_PATH=http://mirror.esc7.net/pub/OpenBSD/$(uname -r)/packages/$(uname -p)/
pkg_add "$( pkg_info -v 'python-<3' | awk '/^@name /{print $2}' )"
ln -s /usr/local/bin/python2.7 /usr/bin/python
# The installer overwrite the hostname.if of the if that was used during installation
echo 'inet {{ internal_ip }} 255.255.255.0 NONE' > /etc/hostname.bge1
echo '129.110.157.1' > /etc/mygate
files="/etc/dhcpd.conf /etc/hostname.* /etc/ntpd.conf /var/unbound/etc/unbound.conf"
if [ $(hostname -s) = "hydrogen" ]; then
name="hydrogen"
int_ip="192.168.42.1"
ext_ip="129.110.157.11"
pf_ip="172.16.0.1"
other_int_ip="192.168.42.2"
advskew="10"
dhcpd_range="192.168.42.128 192.168.42.191"
elif [ $(hostname -s) = "helium" ]; then
name="helium"
int_ip="192.168.42.2"
ext_ip="129.110.157.12"
pf_ip="172.16.0.2"
other_int_ip="192.168.42.1"
advskew="20"
dhcpd_range="192.168.42.192 192.168.42.254"
else
exit
fi
for file in $files; do
temp=$(<$file)
temp=$( echo "$temp" | sed "s/{{ name }}/$name/" )
temp=$( echo "$temp" | sed "s/{{ internal_ip }}/$int_ip/" )
temp=$( echo "$temp" | sed "s/{{ external_ip }}/$ext_ip/" )
temp=$( echo "$temp" | sed "s/{{ pf_ip }}/$pf_ip/" )
temp=$( echo "$temp" | sed "s/{{ peer_internal_ip }}/$other_int_ip/" )
temp=$( echo "$temp" | sed "s/{{ advskew }}/$advskew/" )
temp=$( echo "$temp" | sed "s/{{ dhcpd_range }}/$dhcpd_range/" )
echo "$temp" > $file
done
# Fix the sudoers file
echo 'Defaults !lecture
Defaults:%wheel !env_reset
%wheel ALL=(ALL) SETENV:ALL' >> /etc/sudoers