mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/cli: remove old DNS settings on installing
This commit is contained in:
committed by
Cuong Manh Le
parent
9319d08046
commit
73a697b2fa
@@ -739,6 +739,7 @@ func saveCurrentStaticDNS(iface *net.Interface) error {
|
||||
file := savedStaticDnsSettingsFilePath(iface)
|
||||
ns, _ := currentStaticDNS(iface)
|
||||
if len(ns) == 0 {
|
||||
_ = os.Remove(file) // removing old static DNS settings
|
||||
return nil
|
||||
}
|
||||
if err := os.Remove(file); err != nil && !errors.Is(err, fs.ErrNotExist) {
|
||||
|
||||
Reference in New Issue
Block a user