Add support for setting key_mgmt value

This commit is contained in:
Matias Doyle 2017-12-04 17:37:34 +01:00
parent f41eb91a51
commit abcde53d84

View File

@ -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 {