mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-13 19:27:56 +03:00
Update sing-box core, refactor MASQUE, update XHTTP
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//nolint:unused
|
||||
package settings
|
||||
|
||||
import (
|
||||
@@ -73,13 +74,13 @@ func (m *wpaSupplicantMonitor) ReadWIFIState() adapter.WIFIState {
|
||||
scanner := bufio.NewScanner(strings.NewReader(status))
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if strings.HasPrefix(line, "wpa_state=") {
|
||||
state := strings.TrimPrefix(line, "wpa_state=")
|
||||
if after, ok := strings.CutPrefix(line, "wpa_state="); ok {
|
||||
state := after
|
||||
connected = state == "COMPLETED"
|
||||
} else if strings.HasPrefix(line, "ssid=") {
|
||||
ssid = strings.TrimPrefix(line, "ssid=")
|
||||
} else if strings.HasPrefix(line, "bssid=") {
|
||||
bssid = strings.TrimPrefix(line, "bssid=")
|
||||
} else if after, ok := strings.CutPrefix(line, "ssid="); ok {
|
||||
ssid = after
|
||||
} else if after, ok := strings.CutPrefix(line, "bssid="); ok {
|
||||
bssid = after
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user