mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
confd: remap legacy dhcp client options to consolidated options
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
# Rename DHCP client option attribute 'name' -> 'id' to make DHCP server.
|
||||
# Rename DHCP client option attribute 'name' -> 'id'
|
||||
# to match the DHCP server nomenclature.
|
||||
|
||||
file=$1
|
||||
temp=${file}.tmp
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# Remap DHCP client options to match DHCP server nomenclature.
|
||||
|
||||
file=$1
|
||||
temp=${file}.tmp
|
||||
|
||||
jq '(
|
||||
.["infix-dhcp-client:dhcp-client"]?."client-if"[]?.option[]? |=
|
||||
if has("id") then
|
||||
.id = ({
|
||||
"subnet" : "netmask",
|
||||
"dns" : "dns-server",
|
||||
"ntpsrv" : "ntp-server",
|
||||
"clientid" : "client-id",
|
||||
"staticroutes" : "classless-static-route",
|
||||
"msstaticroutes" : "ms-classless-static-route"
|
||||
}[.id] // .id)
|
||||
else
|
||||
.
|
||||
end
|
||||
)' "$file" > "$temp" &&
|
||||
mv "$temp" "$file"
|
||||
@@ -1,2 +1,3 @@
|
||||
migratedir = $(pkgdatadir)/migrate/1.4
|
||||
dist_migrate_DATA = 10-dhcp-client-option-name.sh
|
||||
dist_migrate_DATA = 10-dhcp-client-option-name.sh \
|
||||
20-dhcp-client-option-remap.sh
|
||||
|
||||
Reference in New Issue
Block a user