mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-12 18:00:49 +01:00
28 lines
432 B
Go
28 lines
432 B
Go
//go:build !ios
|
|
|
|
package dns
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type ShutdownState struct {
|
|
}
|
|
|
|
func (s *ShutdownState) Name() string {
|
|
return "dns_state"
|
|
}
|
|
|
|
func (s *ShutdownState) Cleanup() error {
|
|
manager, err := newHostManager()
|
|
if err != nil {
|
|
return fmt.Errorf("create host manager: %w", err)
|
|
}
|
|
|
|
if err := manager.restoreUncleanShutdownDNS(); err != nil {
|
|
return fmt.Errorf("restore unclean shutdown dns: %w", err)
|
|
}
|
|
|
|
return nil
|
|
}
|