A free open source IT asset/license management system
Revert removing setting hostname (#5208)
tiagom629e7d1b3ed814
diff --git a/snipeit.sh b/snipeit.shindex 1385c0560d..b876f9cb6a 100644--- a/snipeit.sh+++ b/snipeit.sh@@ -28,7 +28,9 @@ clearname="snipeit"verbose="false"+hostname="$(hostname)"fqdn="$(hostname --fqdn)"+hosts=/etc/hostsspin[0]="-"spin[1]="\\"@@ -165,6 +167,11 @@ configureselinux () {fi}+sethostfile () {+ echo "* Setting up hosts file."+ echo >> $hosts "127.0.0.1 $hostname $fqdn"+}+if [[ -f /etc/lsb-release || -f /etc/debian_version ]]; thendistro="$(lsb_release -s -i)"version="$(lsb_release -s -r)"@@ -220,8 +227,12 @@ case $distro inesacshopt -u nocasematch-echo ""-read -rsn1 -p " Press any key to continue..."+echo -n " Q. What is the FQDN of your server? ($fqdn): "+read -r fqdn+if [ -z "$fqdn" ]; then+ fqdn="$(hostname --fqdn)"+fi+echo " Setting to $fqdn"echo ""ans=default@@ -271,6 +282,8 @@ case $distro inlog "a2enmod rewrite"log "a2ensite $name.conf"+ sethostfile+echo "* Securing MariaDB."/usr/bin/mysql_secure_installation@@ -309,6 +322,8 @@ case $distro inlog "a2enmod rewrite"log "a2ensite $name.conf"+ sethostfile+echo "* Securing MariaDB."/usr/bin/mysql_secure_installation@@ -351,6 +366,8 @@ case $distro inlog "a2enmod rewrite"log "a2ensite $name.conf"+ sethostfile+echo "* Starting MariaDB."log "service mysql start"@@ -392,6 +409,8 @@ case $distro inlog "a2enmod rewrite"log "a2ensite $name.conf"+ sethostfile+echo "* Starting MariaDB."log "service mysql start"@@ -443,6 +462,8 @@ case $distro inlog "chkconfig mysql on"log "/sbin/service mysql start"+ sethostfile+echo "* Securing MariaDB."/usr/bin/mysql_secure_installation@@ -478,6 +499,8 @@ case $distro inecho "* Configuring Apache."createvh+ sethostfile+echo "* Setting MariaDB to start on boot and starting MariaDB."log "systemctl enable mariadb.service"log "systemctl start mariadb.service"@@ -514,6 +537,8 @@ case $distro inecho "* Configuring Apache."createvh+ sethostfile+echo "* Setting MariaDB to start on boot and starting MariaDB."log "systemctl enable mariadb.service"log "systemctl start mariadb.service"