2024-01-30 09:58:56 +01:00
|
|
|
//go:build !ios
|
|
|
|
|
|
|
|
package dns
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2024-10-24 10:53:46 +02:00
|
|
|
type ShutdownState struct {
|
|
|
|
}
|
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 {
|
2024-01-30 09:58:56 +01:00
|
|
|
manager, err := newHostManager()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("create host manager: %w", err)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|