aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/netifd/files/etc/uci-defaults/14_migrate-dhcp-release
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/config/netifd/files/etc/uci-defaults/14_migrate-dhcp-release')
-rw-r--r--package/network/config/netifd/files/etc/uci-defaults/14_migrate-dhcp-release23
1 files changed, 23 insertions, 0 deletions
diff --git a/package/network/config/netifd/files/etc/uci-defaults/14_migrate-dhcp-release b/package/network/config/netifd/files/etc/uci-defaults/14_migrate-dhcp-release
new file mode 100644
index 0000000000..651c437cb2
--- /dev/null
+++ b/package/network/config/netifd/files/etc/uci-defaults/14_migrate-dhcp-release
@@ -0,0 +1,23 @@
+. /lib/functions.sh
+
+migrate_release() {
+ local config="$1"
+ local proto
+ local release
+
+ config_get proto "$config" proto
+ config_get release "$config" release
+
+ [ "$proto" = "dhcp" ] && [ -n "$release" ] && {
+ norelease="$((!$release))"
+ uci_set network "$config" norelease "$norelease"
+ uci_remove network "$config" release
+ }
+
+}
+
+config_load network
+config_foreach migrate_release interface
+commit network
+
+exit 0