Don't exit if machine has no ipv6 installed

We are trying to turn off `accept_ra`, so if we get an error that the
option doesn't exist we can just ignore it.
This commit is contained in:
Bryan Boreham committed 2020-06-04 16:12:38 +00:00
1 parent 9be65b466b
commit 7174738d9d
3 files changed
+11 -3

No files matched your search

+8
View File
@@ -41,3 +41,11 @@ func sysctl(procPath, variable, value string) error {
return nil
}
func sysctlIfExists(procPath, variable, value string) error {
err := sysctl(procPath, variable, value)
if err != nil && os.IsNotExist(err) {
err = nil // ignore 'not found' errors
}
return err
}