cmd/cli: re-fetch pin code during deactivation checking

So if the pin code was updated/removed, it will be checked correctly by
ctrld during stop/uninstall commands.
This commit is contained in:
Cuong Manh Le
2024-11-08 18:30:48 +07:00
committed by Cuong Manh Le
parent 2875e22d0b
commit 47a90ec2a1
4 changed files with 35 additions and 12 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ func selfUninstall(p *prog, logger zerolog.Logger) {
}
args := []string{"uninstall"}
if !deactivationPinNotSet() {
args = append(args, fmt.Sprintf("--pin=%d", cdDeactivationPin))
args = append(args, fmt.Sprintf("--pin=%d", cdDeactivationPin.Load()))
}
cmd := exec.Command(bin, args...)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}