summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <codyfh@gmail.com>2018-05-12 20:30:14 -0600
committerCody Hiar <codyfh@gmail.com>2018-05-12 20:30:14 -0600
commit83bb8e8a54c66ae42461819506990207df7549c1 (patch)
tree9614ad1c9aba5a1afbbff5d1b914ea072baa756c
parent7910823bd48800dfa4903fd0047f09255cae04ad (diff)
Minor edits
-rwxr-xr-xdhcp-server.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/dhcp-server.sh b/dhcp-server.sh
index ac4b75c..b6f6487 100755
--- a/dhcp-server.sh
+++ b/dhcp-server.sh
@@ -10,8 +10,7 @@ echo 'Restarting Device'
ip link set "$DEVICE" down
ip link set "$DEVICE" up
# Check if ip already assigned
-IP_ASSIGNED=$(ip a | grep -A 5 ens9 | grep 192.168.123.1)
-if [ -z "$IP_ASSIGNED" ]; then
+if [ -z "$(ip a | grep -A 5 ens9 | grep 192.168.123.1)" ]; then
ip addr add "$ROUTERIP"/24 dev "$DEVICE" # arbitrary address
fi
@@ -26,7 +25,7 @@ echo 'Creating /etc/dhcpd.conf file'
cat > /etc/dhcpd.conf <<- EOM
option domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.255.255.0;
-option routers 192.168.123.100;
+option routers $ROUTERIP;
subnet 192.168.123.0 netmask 255.255.255.0 {
range 192.168.123.150 192.168.123.250;
}