A free open source IT asset/license management system
Deb/Ubu pro bar & Ubu 16 php-xml pkg (#2644)
Michael Tbcc6ca5180cb
diff --git a/snipeit.sh b/snipeit.shindex 758a464bd9..ae530bf25e 100755--- a/snipeit.sh+++ b/snipeit.sh@@ -31,9 +31,31 @@ file=master.ziptmp=/tmp/$namefileName=snipe-it-master+spin[0]="-"+spin[1]="\\"+spin[2]="|"+spin[3]="/"+rm -rf $tmp/mkdir $tmp+# Debian/Ubuntu friendly f(x)+progress () {+ while kill -0 $pid > /dev/null 2>&1+ do+ for i in "${spin[@]}"+ do+ if [ -e /proc/$pid ]; then+ echo -ne "\b$i"+ sleep .1+ else+ echo -ne "\n\n"+ fi+ done+ done+}++function isinstalled {if yum list installed "$@" >/dev/null 2>&1; thentrue@@ -116,9 +138,9 @@ case $setpw inecho -n " Q. What do you want your snipeit user password to be?"read -s mysqluserpwecho ""- ans="no"+ ans="no";;- *) echo " Invalid answer. Please type y or n"+ *) echo " Invalid answer. Please type y or n";;esacdone@@ -149,14 +171,17 @@ case $distro inecho "## Updating Debian packages in the background. Please be patient."echo ""apachefile=/etc/apache2/sites-available/$name.conf- sudo apt-get update >> /var/log/snipeit-install.log 2>&1- sudo apt-get -y upgrade >> /var/log/snipeit-install.log 2>&1-+ sudo apt-get update >> /var/log/snipeit-install.log & pid=$! 2>&1+ progress+ sudo apt-get -y upgrade >> /var/log/snipeit-install.log & pid=$! 2>&1+ progressecho "## Installing packages."sudo apt-get -y install mariadb-server mariadb-clientecho "## Going to suppress more messages that you don't need to worry about. Please wait."- sudo apt-get -y install apache2 >> /var/log/snipeit-install.log 2>&1- sudo apt-get install -y git unzip php5 php5-mcrypt php5-curl php5-mysql php5-gd php5-ldap libapache2-mod-php5 curl >> /var/log/snipeit-install.log 2>&1+ sudo apt-get -y install apache2 >> /var/log/snipeit-install.log & pid=$! 2>&1+ progress+ sudo apt-get install -y git unzip php5 php5-mcrypt php5-curl php5-mysql php5-gd php5-ldap libapache2-mod-php5 curl >> /var/log/snipeit-install.log & pid=$! 2>&1+ progress# Get files and extract to web direcho ""@@ -209,14 +234,13 @@ case $distro in#Modify the Snipe-It files necessary for a production environment.echo "## Modify the Snipe-It files necessary for a production environment."-echo "## Securing Mysql"# Have user set own root password when securing install# and just set the snipeit database user at the beginning/usr/bin/mysql_secure_installation## TODO make sure mysql is set to start on boot and go ahead and start it-+echo "Creating Mysql Database and User."echo "## Please Input your MySQL/MariaDB root password: "echo ""@@ -250,17 +274,26 @@ case $distro inecho ""echo "## Updating ubuntu in the background. Please be patient."echo ""+ echo -n "Updating with apt-get update... ${spin[0]}"+ sudo apt-get update >> /var/log/snipeit-install.log & pid=$! 2>&1+ progress+ echo -n "Upgrading packages with apt-get upgrade... ${spin[0]}"+ sudo apt-get -y upgrade >> /var/log/snipeit-install.log & pid=$! 2>&1+ progressapachefile=/etc/apache2/sites-available/$name.conf- sudo apt-get update >> /var/log/snipeit-install.log 2>&1- sudo apt-get -y upgrade >> /var/log/snipeit-install.log 2>&1echo "## Installing packages."#We already established MySQL root & user PWs, so we dont need to be prompted. Let's go ahead and install Apache, PHP and MySQL.echo "## Setting up LAMP."- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y lamp-server^ >> /var/log/snipeit-install.log 2>&1-+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y lamp-server^ >> /var/log/snipeit-install.log & pid=$! 2>&1+ echo ""+ progressif [ "$version" == "16.04" ]; then+<<<<<<< HEAD+ sudo apt-get install -y git unzip php php-mcrypt php-curl php-mysql php-gd php-ldap php-zip php-mbstring php-xml >> /var/log/snipeit-install.log 2>&1+=======sudo apt-get install -y git unzip php php-mcrypt php-curl php-mysql php-gd php-ldap php-xml php-zip php-mbstring >> /var/log/snipeit-install.log 2>&1+>>>>>>> 7fdd4fbe987a00138f2e4b1695d67d3069bc1359#Enable mcrypt and rewriteecho "## Enabling mcrypt and rewrite"sudo phpenmod mcrypt >> /var/log/snipeit-install.log 2>&1@@ -282,8 +315,6 @@ case $distro in## TODO make sure apache is set to start on boot and go ahead and start it--sudo ls -al /etc/apache2/mods-enabled/rewrite.load >> /var/log/snipeit-install.log 2>&1#Create a new virtual host for Apache.@@ -305,7 +336,7 @@ case $distro inecho "## Setting up hosts file."echo >> $hosts "127.0.0.1 $hostname $fqdn"- a2ensite $name.conf >> /var/log/snipeit-install.log 2>&1+ a2ensite $name.conf >> /var/log/snipeit-install.logcat > $webdir/$name/.env <<-EOF#Created By Snipe-it Installer@@ -320,7 +351,7 @@ case $distro inEOF## TODO make sure mysql is set to start on boot and go ahead and start it-+ echo "## MySQL Phase next."# Setup Mysql, then run the command./usr/bin/mysql_secure_installationecho "## Creating MySQL Database and user. "