echo $(date) >> "$INSTALL_LOG"
echo "Setting Hostname"
sleep 2
-echo "drone_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 "drone_file" > /etc/hostname
+ start hostname
+else
+ hostnamectl set-hostname "drone_file"
+fi
tar zxvf drone_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
### Set hostname.
echo "Setting Hostname"
sleep 2
-echo "tar_file" > /etc/hostname
-# Get_OS_Distro
-if [ "$OSDISTRO" == "Ubuntu" ]
- then
- start hostname
- else
- /etc/init.d/hostname.sh
+# 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 "tar_file" > /etc/hostname
+ start hostname
+else
+ hostnamectl set-hostname "tar_file"
fi
-
-
-
### xtract /etc/hosts files.
echo "Files Installed"