fix(checkers): use privileged ICMP mode when running as root
This commit is contained in:
parent
462aa0b31f
commit
cc8bceb1be
1 changed files with 3 additions and 1 deletions
|
|
@ -22,13 +22,15 @@
|
|||
package checkers
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
ping "git.happydns.org/checker-ping/checker"
|
||||
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||
"git.happydns.org/happyDomain/internal/dnschecker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
prvd := ping.Provider()
|
||||
prvd := ping.ProviderWithPrivileged(os.Getuid() == 0)
|
||||
dnschecker.RegisterObservationProvider(prvd)
|
||||
dnschecker.RegisterExternalizableChecker(prvd.(sdk.CheckerDefinitionProvider).Definition())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue