mirror of
https://github.com/taigrr/golang-wpasupplicant
synced 2025-01-18 04:43:18 -08:00
Add support for setting key_mgmt value
This commit is contained in:
parent
f41eb91a51
commit
abcde53d84
11
unixgram.go
11
unixgram.go
@ -303,7 +303,16 @@ func (uc *unixgramConn) RemoveAllNetworks() error {
|
||||
}
|
||||
|
||||
func (uc *unixgramConn) SetNetwork(networkID int, variable string, value string) error {
|
||||
return uc.runCommand(fmt.Sprintf("SET_NETWORK %d %s \"%s\"", networkID, variable, value))
|
||||
var cmd string
|
||||
|
||||
// Since key_mgmt expects the value to not be wrapped in "" we do a little check here.
|
||||
if variable == "key_mgmt" {
|
||||
cmd = fmt.Sprintf("SET_NETWORK %d %s %s", networkID, variable, value)
|
||||
} else {
|
||||
cmd = fmt.Sprintf("SET_NETWORK %d %s \"%s\"", networkID, variable, value)
|
||||
}
|
||||
|
||||
return uc.runCommand(cmd)
|
||||
}
|
||||
|
||||
func (uc *unixgramConn) SaveConfig() error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user