wifi-scripts: fix handling changes to the wifi device disabled flag

Allow toggling autostart even for disabled devices
When switching from enabled to disabled, call teardown instead of setup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2025-08-04 11:46:05 +02:00
parent f3dd291b62
commit de447b93e0

View File

@ -391,11 +391,14 @@ function update(data)
function start()
{
if (this.delete || this.data.config.disabled)
if (this.delete)
return;
this.dbg("start, state=" + this.state);
this.autostart = true;
if (this.data.config.disabled)
return;
wdev_reset(this);
if (this.state != "down")
@ -427,7 +430,10 @@ function check()
return;
wdev_config_init(this);
this.setup();
if (this.data.config.disabled)
this.teardown();
else
this.setup();
}
function wdev_mark_up(wdev)