Skip to content

Instantly share code, notes, and snippets.

@ssmythe
Created February 26, 2016 05:45
Show Gist options
  • Save ssmythe/e9a351b6005fdfd62053 to your computer and use it in GitHub Desktop.
Save ssmythe/e9a351b6005fdfd62053 to your computer and use it in GitHub Desktop.
Fixes /etc/dhcp/dhclient.conf when using base centos6 build script when hostname is localhost
#!/usr/bin/env bash
echo "patch: patching /etc/dhcp/dhclient.conf"
sed -i "s/localhost/$(hostname)/g" /etc/dhcp/dhclient.conf
/sbin/service network restart
echo "patch: display hostname FQDN"
hostname -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment