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