unet-cli: only apply defaults on create
authorFelix Fietkau <nbd@nbd.name>
Mon, 16 Dec 2024 12:34:34 +0000 (13:34 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 16 Dec 2024 12:34:34 +0000 (13:34 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
scripts/unet-cli

index 9cbe64f14bdcf35e44e71a3ca344dedb825afe99..5efd57054c58eb38d7cc8053863c28be363923fc 100755 (executable)
@@ -399,10 +399,11 @@ switch (command) {
 case 'import':
        break;
 case 'create':
-case 'set-config':
        for (let key, val in defaults)
                args[key] ??= `${val}`;
 
+       // fallthrough
+case 'set-config':
        set_fields(net_data.config, {
                port: "int",
                keepalive: "int",