echo "Setting Hostname"
sleep 2
-echo "head_file" > /etc/hostname
+# supported Debian releases and Ubuntu 16.04 are on systemd
+# so check to see if we're running 14.04, otherwise, we're
+# on a systemd-based system
+#Get_OS_Distro
+if [ "$OSDISTRO" == "Ubuntu" && "$OSRELEASE" == "14.04" ]; then
+ echo "head_file" > /etc/hostname
+ start hostname
+else
+ hostnamectl set-hostname "head_file"
+fi
tar zxvf head_file_etc-hosts.tar.gz -C /
sed -i 's/^domain.*/domain CLUSTER_DOMAINNAME/g' /etc/resolv.conf
sed -i 's/^search.*/search CLUSTER_DOMAINNAME/g' /etc/resolv.conf
-#Get_OS_Distro
-if [ "$OSDISTRO" == "Ubuntu" ]
- then
- start hostname
- else
- /etc/init.d/hostname.sh
-fi
### Add backports if debian 6.x
if grep -q 'Debian GNU/Linux 6' /etc/issue
### Set install log
INSTALL_LOG="/var/log/genasys_install.log"
-OSDISTRO=$(cat /etc/issue|head -1|awk '{ print $1 }')
+OSDISTRO=$(lsb_release -i | awk '{ print $1 }')
+OSRELEASE=$(lsb_release -r | awk '{print $2}')
#Get_OS_Distro
if [ "$OSDISTRO" == "Debian" ]