-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvbox-network.sh
30 lines (26 loc) · 1.13 KB
/
vbox-network.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
# If /etc/vbox doesn't exist create it
if [ ! -d /etc/vbox ]; then
echo "Creating directory /etc/vbox"
mkdir /etc/vbox
fi
# if file /etc/vbox/networks.conf doesn't exist create it
if [ ! -f /etc/vbox/networks.conf ]; then
echo "Creating file /etc/vbox/networks.conf"
touch /etc/vbox/networks.conf
fi
# if file /etc/vbox/networks.conf doesn't contain "* 172.28.128.0/16" add it
if ! grep -q "* 172.28.128.0/16" /etc/vbox/networks.conf; then
echo "Adding '* 172.28.128.0/16' to /etc/vbox/networks.conf"
echo "* 172.28.128.0/16" > /etc/vbox/networks.conf
fi
# if file /etc/vbox/networks.conf doesn't contain "* 172.28.128.0/16" add it
if ! grep -q "* 172.28.128.0/16" /etc/vbox/networks.conf; then
echo "Adding '* 172.28.128.0/16' to /etc/vbox/networks.conf"
echo "* 172.28.128.0/16" >> /etc/vbox/networks.conf
fi
# if file /etc/vbox/networks.conf doesn't contain "* 192.168.20.0/16" add it
# This is necessary for the client network
if ! grep -q "* 192.168.20.0/16" /etc/vbox/networks.conf; then
echo "Adding '* 192.168.20.0/16' to /etc/vbox/networks.conf"
echo "* 192.168.20.0/16" >> /etc/vbox/networks.conf
fi