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
+16
View File
@@ -0,0 +1,16 @@
//go:build !unix
package cli
import (
"os"
"github.com/rs/zerolog"
)
func selfUninstall(err error, p *prog, logger zerolog.Logger) {
if uninstallIfInvalidCdUID(err, p, logger) {
logger.Warn().Msgf("service was uninstalled because device %q does not exist", cdUID)
os.Exit(0)
}
}