mirror of
https://github.com/immortalwrt/immortalwrt.git
synced 2025-08-07 22:06:25 +08:00
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:
@ -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)
|
||||
|
Reference in New Issue
Block a user