Files
ctrld/cmd/cli/self_kill_others.go
Cuong Manh Le 905f2d08c5 cmd/cli: fix reset DNS when doing self-uninstall
While at it, also using "ctrld uninstall" on unix platform, ensuring
everything is cleanup properly.
2024-08-07 15:51:11 +07:00

17 lines
291 B
Go

//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)
}
}