A free open source IT asset/license management system
Add support for Debian 10 (#7414)
Earl Ramirez6a8d5282efb2
diff --git a/snipeit.sh b/snipeit.shindex d6d65619b8..76b784c052 100755--- a/snipeit.sh+++ b/snipeit.sh@@ -156,8 +156,8 @@ create_virtualhost () {create_user () {echo "* Creating Snipe-IT user."- if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == "raspbian" ] ; then- adduser --quiet --disabled-password --gecos '""' "$APP_USER"+ if [[ "$distro" == "ubuntu" ]] || [[ "$distro" == "debian" ]] || [[ "$distro" == "raspbian" ]] ; then+ adduser --quiet --disabled-password --gecos 'Snipe-IT User' "$APP_USER"elseadduser "$APP_USER"fi@@ -265,7 +265,13 @@ set_hosts () {echo >> /etc/hosts "127.0.0.1 $(hostname) $fqdn"}-if [[ -f /etc/lsb-release || -f /etc/debian_version ]]; then+rename_default_vhost () {+ log "mv /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/111-default.conf"+ log "mv /etc/apache2/sites-enabled/snipeit.conf /etc/apache2/sites-enabled/000-snipeit.conf"+}+++if [[ -f /etc/debian_version || -f /etc/lsb-release ]]; thendistro="$(lsb_release -is)"version="$(lsb_release -rs)"codename="$(lsb_release -cs)"@@ -311,7 +317,7 @@ case $distro inapache_group=www-dataapachefile=/etc/apache2/sites-available/$APP_NAME.conf;;- *debian*)+ *Debian|debian*)echo " The installer has detected $distro version $version codename $codename."distro=debianapache_group=www-data@@ -330,7 +336,7 @@ case $distro inapachefile=/etc/httpd/conf.d/$APP_NAME.conf;;*)- echo " The installer was unable to determine your OS. Exiting for safety."+ echo " The installer was unable to determine your OS. Exiting for safety. Exiting for safety."exit 1;;esac@@ -368,7 +374,39 @@ donecase $distro indebian)- if [[ "$version" =~ ^9 ]]; then+ if [[ "$version" =~ ^10 ]]; then+ # Install for Debian 10.x+ tzone=$(cat /etc/timezone)++ echo "* Adding PHP repository."+ log "apt-get install -y apt-transport-https lsb-release ca-certificates"+ log "wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg"+ echo "deb https://packages.sury.org/php/ $codename main" > /etc/apt/sources.list.d/php.list++ echo -n "* Updating installed packages."+ log "apt-get update && apt-get -y upgrade" & pid=$!+ progress++ echo "* Installing Apache httpd, PHP, MariaDB and other requirements."+ PACKAGES="mariadb-server mariadb-client apache2 libapache2-mod-php7.3 php7.3 php7.3-mcrypt php7.3-curl php7.3-mysql php7.3-gd php7.3-ldap php7.3-zip php7.3-mbstring php7.3-xml php7.3-bcmath curl git unzip"+ install_packages++ echo "* Configuring Apache."+ create_virtualhost+ log "a2enmod rewrite"+ log "a2ensite $APP_NAME.conf"+ rename_default_vhost++ set_hosts++ echo "* Securing MariaDB."+ /usr/bin/mysql_secure_installation++ install_snipeit++ echo "* Restarting Apache httpd."+ log "service apache2 restart"+ elif [[ "$version" =~ ^9 ]]; then# Install for Debian 9.xtzone=$(cat /etc/timezone)@@ -389,6 +427,7 @@ case $distro increate_virtualhostlog "a2enmod rewrite"log "a2ensite $APP_NAME.conf"+ rename_default_vhostset_hosts@@ -422,6 +461,7 @@ case $distro increate_virtualhostlog "a2enmod rewrite"log "a2ensite $APP_NAME.conf"+ rename_default_vhostset_hosts@@ -456,8 +496,7 @@ case $distro inlog "phpenmod mbstring"log "a2enmod rewrite"log "a2ensite $APP_NAME.conf"- log "mv /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/111-default.conf"- log "mv /etc/apache2/sites-enabled/snipeit.conf /etc/apache2/sites-enabled/000-snipeit.conf"+ rename_default_vhostset_hosts