mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/cli: honoring "iface" value in resetDnsTask
Otherwise, ctrld service command will always do reset DNS while it should not.
This commit is contained in:
committed by
Cuong Manh Le
parent
5af3ec4f7b
commit
70b0c4f7b9
@@ -2649,6 +2649,9 @@ func resetDnsTask(p *prog, s service.Service) task {
|
||||
isCtrldInstalled := !errors.Is(err, service.ErrNotInstalled)
|
||||
isCtrldRunning := status == service.StatusRunning
|
||||
return task{func() error {
|
||||
if iface == "" {
|
||||
return nil
|
||||
}
|
||||
// Always reset DNS first, ensuring DNS setting is in a good state.
|
||||
// resetDNS must use the "iface" value of current running ctrld
|
||||
// process to reset what setDNS has done properly.
|
||||
|
||||
Reference in New Issue
Block a user