diff --git a/uci_dhcp_conf.go b/uci_dhcp_conf.go index 1fcb788..8823994 100644 --- a/uci_dhcp_conf.go +++ b/uci_dhcp_conf.go @@ -36,6 +36,17 @@ func (dh *UCIDHCPConf) Create() *Action { return result } for key, value := range conf { + fmt.Printf("DEBUG %s == %s\n", key, value) + if value == "" { + return &Action{ + CommandResult: &CommandResult{ + Stdout: "", + Stderr: fmt.Sprintf("dhcp.%s can't be empty", key), + ReturnCode: 100, + }, + Command: "Empty value error", + } + } result := uci.Set(fmt.Sprintf("dhcp.%s.%s", dh.Name, key), value) if result.ReturnCode != 0 { return result