mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-11 15:44:52 +08:00
force lowercase for /etc/hosts profile names
to test: create newtwork with Upper case name check profile in /etc/hosts is created with all lowercase
This commit is contained in:
parent
a5ab97b712
commit
afe12b277d
1 changed files with 2 additions and 2 deletions
|
@ -244,7 +244,7 @@ func setHostDNS(dns, iface string, windows bool) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
profile.Name = iface
|
||||
profile.Name = strings.ToLower(iface)
|
||||
profile.Status = types.Enabled
|
||||
if err := hosts.ReplaceProfile(profile); err != nil {
|
||||
return err
|
||||
|
@ -264,7 +264,7 @@ func removeHostDNS(iface string, windows bool) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := hosts.RemoveProfile(iface); err != nil {
|
||||
if err := hosts.RemoveProfile(strings.ToLower(iface)); err != nil {
|
||||
if err == types.ErrUnknownProfile {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue