Module: Landrush::Cap::Redhat::RestartDnsmasq
- Defined in:
- lib/landrush/cap/host/redhat/restart_dnsmasq.rb
Constant Summary collapse
- SED_COMMAND =
<<-EOF.gsub(/^ +/, '') sudo sed -i.orig '1 i\ # Added by landrush, a vagrant plugin \\ nameserver 127.0.0.1 \\ ' /etc/resolv.conf EOF
Class Method Summary collapse
Class Method Details
.restart_dnsmasq(_env) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/landrush/cap/host/redhat/restart_dnsmasq.rb', line 15 def restart_dnsmasq(_env) # TODO: At some stage we might want to make create_dnsmasq_config host specific and add the resolv.conf # changes there which seems more natural if Landrush::Util::Dnsmasq.nm_managed? system('sudo systemctl reload NetworkManager') else system(SED_COMMAND) unless system("cat /etc/resolv.conf | grep 'nameserver 127.0.0.1' > /dev/null 2>&1") system('sudo systemctl restart dnsmasq') end end |