#!/bin/bash

if [ -z "$1" ]
  then
    echo "No argument supplied"
else
echo "$1" > /etc/hostname
echo "127.0.0.1	localhost" > /etc/hosts
echo "127.0.1.1	$1" >> /etc/hosts
echo "::1     ip6-localhost ip6-loopback" >> /etc/hosts
echo "fe00::0 ip6-localnet" >> /etc/hosts
echo "ff00::0 ip6-mcastprefix" >> /etc/hosts
echo "ff02::1 ip6-allnodes" >> /etc/hosts
echo "ff02::2 ip6-allrouters" >> /etc/hosts
#perl -i -p -e 's/nexp-ubuntu-14/'$1'/g;' /etc/hostname
#perl -i -p -e 's/nexp-ubuntu-14/'$1'/g;' /etc/hosts
fi
