Move dhcpd.conf preamble into a separate file.
This commit is contained in:
@@ -6,19 +6,9 @@ do_curl() {
|
||||
curl -s -k -H "Authorization: Token ${TOKEN}" -X GET $1
|
||||
}
|
||||
|
||||
cat<<EOF
|
||||
# generated by $0 at $(date)
|
||||
|
||||
option domain-name "home.paler.net";
|
||||
max-lease-time 600;
|
||||
default-lease-time 600;
|
||||
|
||||
subnet 192.168.1.0 netmask 255.255.255.0 {
|
||||
option routers 192.168.1.1;
|
||||
option domain-name-servers 192.168.1.1;
|
||||
range 192.168.1.100 192.168.1.200;
|
||||
|
||||
EOF
|
||||
echo "# generated by $0 at $(date)"
|
||||
echo
|
||||
cat dhcpd.conf.head
|
||||
|
||||
do_curl "https://${NETBOX}/api/ipam/ip-addresses/" | \
|
||||
jq -r '.results[] | .assigned_object.device.name + .assigned_object.virtual_machine.name + " " + (.address / "/")[0] + " " + .assigned_object.url' |
|
||||
|
||||
Reference in New Issue
Block a user