strongswan: move uci-defaults migration into subfunction

To make the migration script more organized, the migration for the 'ipsec'
unamed section to 'ipsec' named section 'globals' has been moved to a
subfunction.

The change prepares the new migration script to migrate other areas.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert authored and Philip Prindeville committed 2026-07-16 14:27:36 -06:00
1 parent 89530694ff
commit 46fb7ec434
1 file changed
+5 -1
@@ -1,6 +1,6 @@
#!/bin/sh
main() {
migrate_ipsec() {
# Skip migration if the 'globals' section already exists
uci show ipsec.globals 1>/dev/null 2>/dev/null
[ "$?" = "0" ] && return
@@ -10,6 +10,10 @@ main() {
uci -q commit ipsec
}
main() {
migrate_ipsec
}
main
exit 0