diff options
| author | Felix Fietkau | 2025-02-26 09:41:48 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2025-03-17 12:16:48 +0000 |
| commit | 2055b73ba4b9a63973568104e86171a6bb47d61d (patch) | |
| tree | 84d259e57c43af6016c721fa37aab3e9bb231df4 | |
| parent | 7c04fa0328215835218f18d7bb07edb999fde117 (diff) | |
| download | openwrt-2055b73ba4b9a63973568104e86171a6bb47d61d.tar.gz | |
unetd: cli: add unet_create/update/delete hook calls
Useful for upcoming cli modules that store created interfaces separately
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | package/network/services/unetd/files/unet.uc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/package/network/services/unetd/files/unet.uc b/package/network/services/unetd/files/unet.uc index d9533d3fa3..30ad452c04 100644 --- a/package/network/services/unetd/files/unet.uc +++ b/package/network/services/unetd/files/unet.uc @@ -153,6 +153,7 @@ function network_sign_data(ctx, name, network, pw_file, upload) function network_create_uci(model, name, iface) { + model.run_hook("unet_create", name, iface); let cur = uci.cursor(null, null, ""); cur.set("network", name, "interface"); for (let key, val in iface) @@ -361,6 +362,7 @@ function network_create(ctx, argv, named) { function network_delete(ctx, argv) { let name = argv[0]; let cur = uci.cursor(null, null, ""); + model.run_hook("unet_delete", name); if (!cur.delete("network", name)) return ctx.command_failed("Command failed"); @@ -378,6 +380,7 @@ function network_iface_save(ctx) if (!netdata.iface_changed) return; + model.run_hook("unet_update", network, netdata.iface); let cur = uci.cursor(null, null, ""); let iface_orig = cur.get_all("network", network); for (let name, val in netdata.iface) { |