From: Tom Hughes Date: Sat, 23 Nov 2013 12:13:18 +0000 (+0000) Subject: Avoid shelling out to sysctl when we can read /proc/sys X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/a585c97b901ea250d40f2d924d1a8ac5949751a4 Avoid shelling out to sysctl when we can read /proc/sys --- diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 33f51097e..3a5be0d61 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -116,7 +116,7 @@ else end end -if %x{sysctl -n net.ipv4.ip_forward}.chomp == "1" +if File.read("/proc/sys/net/ipv4/ip_forward").chomp == "1" munin_plugin "fw_packets" else munin_plugin "fw_packets" do