mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
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:
committed by
Cuong Manh Le
parent
2875e22d0b
commit
47a90ec2a1
+5
-4
@@ -275,15 +275,16 @@ func (p *prog) apiConfigReload() {
|
||||
|
||||
if resolverConfig.DeactivationPin != nil {
|
||||
newDeactivationPin := *resolverConfig.DeactivationPin
|
||||
curDeactivationPin := cdDeactivationPin.Load()
|
||||
switch {
|
||||
case deactivationPin != defaultDeactivationPin:
|
||||
case curDeactivationPin != defaultDeactivationPin:
|
||||
logger.Debug().Msg("saving deactivation pin")
|
||||
case deactivationPin != newDeactivationPin:
|
||||
case curDeactivationPin != newDeactivationPin:
|
||||
logger.Debug().Msg("update deactivation pin")
|
||||
}
|
||||
cdDeactivationPin = *resolverConfig.DeactivationPin
|
||||
cdDeactivationPin.Store(newDeactivationPin)
|
||||
} else {
|
||||
deactivationPin = defaultDeactivationPin
|
||||
cdDeactivationPin.Store(defaultDeactivationPin)
|
||||
}
|
||||
|
||||
if resolverConfig.Ctrld.CustomConfig == "" {
|
||||
|
||||
Reference in New Issue
Block a user