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:
1 parent
9be65b466b
commit
7174738d9d
3 files changed
+11
-3
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user