Skip to content

Instantly share code, notes, and snippets.

@niiku-y
Created December 8, 2018 12:23
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 niiku-y/e1d2feced0b22137bdeab9432b41904b to your computer and use it in GitHub Desktop.
Save niiku-y/e1d2feced0b22137bdeab9432b41904b to your computer and use it in GitHub Desktop.
#!/bin/bash
# init_ubu16.sh
echo "backup resolv.conf, resolv.conf.d/base"
cp /etc/resolv.conf /etc/.resolv.conf.org
cp /etc/resolvconf/resolv.conf.d/base /etc/resolvconf/resolv.conf.d/.base.org
echo "nameserver 8.8.8.8" >> /etc/resolvconf/resolv.conf.d/base
resolvconf -u
echo ""
echo "/etc/resolv.conf (after) : "
cat /etc/resolv.conf
echo ""
echo "package update ..."
sudo apt-get update && sudo apt-get upgrade -y
cat <<EOF >> /etc/hosts
192.168.0.108 lb01.openstacklocal lb01
192.168.0.109 master01
192.168.0.110 master02
192.168.0.111 master03
EOF
echo ""
echo "/etc/hosts : "
cat /etc/hosts
echo ""
echo "finish."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment