mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Merge pull request #1454 from kernelkit/add-migrate-script
Add migration script for confd: prevent IP addresses on bridge ports
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# Remove ietf-ip:ipv4 and ietf-ip:ipv6 from bridge port interfaces.
|
||||
# Bridge ports should not have IP addresses; the IP address should
|
||||
# be configured on the bridge interface itself.
|
||||
file=$1
|
||||
temp=${file}.tmp
|
||||
|
||||
jq '
|
||||
if .["ietf-interfaces:interfaces"]?.interface then
|
||||
.["ietf-interfaces:interfaces"].interface |= map(
|
||||
if .["infix-interfaces:bridge-port"] and .type != "infix-if-type:bridge" then
|
||||
del(.["ietf-ip:ipv4"], .["ietf-ip:ipv6"])
|
||||
else
|
||||
.
|
||||
end
|
||||
)
|
||||
else
|
||||
.
|
||||
end
|
||||
' "$file" > "$temp" && mv "$temp" "$file"
|
||||
@@ -1,4 +1,5 @@
|
||||
migratedir = $(pkgdatadir)/migrate/1.6
|
||||
dist_migrate_DATA = 10-dhcp-client-to-ipv4.sh \
|
||||
20-autoconf-to-presence.sh \
|
||||
30-ospf-backbone-area-type.sh
|
||||
30-ospf-backbone-area-type.sh \
|
||||
40-bridge-port-remove-ip.sh
|
||||
|
||||
Reference in New Issue
Block a user