mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02: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)
|
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