13 lines
382 B
Bash
13 lines
382 B
Bash
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
API_KEY=
|
||
|
|
URL=https://phantom1.lan:53443
|
||
|
|
|
||
|
|
awk '{print $2,$6,$8}' dhcp.static | tr -d \; | grep '192.168.2\.' | while read -r domain mac ipaddr; do
|
||
|
|
echo -n "$domain|$mac|$ipaddr"
|
||
|
|
curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/dhcp/scopes/addReservedLease?name=dhcp2&hardwareAddress=$mac&ipAddress=$ipaddr&hostName=$domain"
|
||
|
|
echo
|
||
|
|
done
|
||
|
|
|
||
|
|
|