2024-01-30 09:58:56 +01:00
|
|
|
package dns
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2024-10-24 10:53:46 +02:00
|
|
|
type ShutdownState struct {
|
|
|
|
Guid string
|
2025-02-13 18:17:18 +01:00
|
|
|
GPO bool
|
2024-10-24 10:53:46 +02:00
|
|
|
}
|
2024-01-30 09:58:56 +01:00
|
|
|
|
2024-10-24 10:53:46 +02:00
|
|
|
func (s *ShutdownState) Name() string {
|
|
|
|
return "dns_state"
|
|
|
|
}
|
2024-01-30 09:58:56 +01:00
|
|
|
|
2024-10-24 10:53:46 +02:00
|
|
|
func (s *ShutdownState) Cleanup() error {
|
2025-02-13 18:17:18 +01:00
|
|
|
manager := ®istryConfigurator{
|
|
|
|
guid: s.Guid,
|
|
|
|
gpo: s.GPO,
|
2024-01-30 09:58:56 +01:00
|
|
|
}
|
|
|
|
|
2024-10-24 10:53:46 +02:00
|
|
|
if err := manager.restoreUncleanShutdownDNS(); err != nil {
|
|
|
|
return fmt.Errorf("restore unclean shutdown dns: %w", err)
|
2024-01-30 09:58:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|