cmd/cli: fix reset DNS when doing self-uninstall

While at it, also using "ctrld uninstall" on unix platform, ensuring
everything is cleanup properly.
This commit is contained in:
Cuong Manh Le
2024-07-25 22:23:01 +07:00
committed by Cuong Manh Le
parent 04947b4d87
commit 905f2d08c5
4 changed files with 79 additions and 18 deletions
+2 -3
View File
@@ -862,9 +862,8 @@ func (p *prog) doSelfUninstall(answer *dns.Msg) {
p.checkingSelfUninstall = true
_, err := controld.FetchResolverConfig(cdUID, rootCmd.Version, cdDev)
logger.Debug().Msg("maximum number of refused queries reached, checking device status")
if uninstallIfInvalidCdUID(err, logger) {
logger.Fatal().Msgf("service was uninstalled because device %q does not exist", cdUID)
}
selfUninstall(err, p, logger)
if err != nil {
logger.Warn().Err(err).Msg("could not fetch resolver config")
}