Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cncolder/368007 to your computer and use it in GitHub Desktop.
Save cncolder/368007 to your computer and use it in GitHub Desktop.
File.open("/etc/bootpd.plist", "r+") do |f|
while l = f.gets
if l =~ /detect_other_dhcp_server/
puts "disable dhcp detect at line : #{f.lineno}"
f.puts "\t<integer>0</integer>\n"
end
end
end
pid = `ps -e | grep bootpd | grep -v grep | awk '{print $1}'`
puts "tell bootpd reload configure : #{Process.kill('HUP', pid.to_i)}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment