diff options
author | Ole Mathias Aa. Heggem <olemathias.aa.heggem@gmail.com> | 2019-11-11 22:14:22 +0100 |
---|---|---|
committer | Ole Mathias Aa. Heggem <olemathias.aa.heggem@gmail.com> | 2019-11-11 22:14:22 +0100 |
commit | ef8122013956d09127c25285fde92b39c4e8af55 (patch) | |
tree | 34ce1266ae41d86e9378f481c1afb1e00be9c90c /examples/tg19/dhcp/tools | |
parent | 1f190fed23d84fa00559653e868e6be5ff6451aa (diff) |
A little TG19 scripts and config
Diffstat (limited to 'examples/tg19/dhcp/tools')
-rwxr-xr-x | examples/tg19/dhcp/tools/make_dhcp.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/tg19/dhcp/tools/make_dhcp.sh b/examples/tg19/dhcp/tools/make_dhcp.sh new file mode 100755 index 0000000..4e33d0e --- /dev/null +++ b/examples/tg19/dhcp/tools/make_dhcp.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +curl --user tech:<Removed> https://gondul.tg19.gathering.org/api/templates/dhcpd.conf > /etc/dhcp/automatic_zones_v4.conf +curl --user tech:<Removed> https://gondul.tg19.gathering.org/api/templates/dhcpd6.conf > /etc/dhcp/automatic_zones_v6.conf +curl --user tech:<Removed> https://gondul.tg19.gathering.org/api/templates/fap_dhcp4.conf > /etc/dhcp/automatic_zones_fap4.conf + +/usr/sbin/dhcpd -4 -t -cf /etc/dhcp/dhcpd.conf +if [ $? -eq 0 ] +then + /usr/sbin/service isc-dhcp-server4 restart + if [ $? -eq 0 ] + then + echo "Restarted isc-dhcp-server4 success!" + else + echo "Failed to restart DHCPv4, panic!" + exit 1 + fi +else + echo "DHCPv4 failed! Not restarted" + exit 1 +fi +/usr/sbin/dhcpd -6 -t -cf /etc/dhcp/dhcpd6.conf +if [ $? -eq 0 ] +then + /usr/sbin/service isc-dhcp-server6 restart + if [ $? -eq 0 ] + then + echo "Restarted isc-dhcp-server6 success!" + else + echo "Failed to restart DHCPv6, panic!" + exit 1 + fi +else + echo "DHCPv6 failed! Not restarted" + exit 1 +fi |