mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Add support for Debian 10 (#7414)
This commit is contained in:
parent
c9ec15101c
commit
6a8d5282ef
55
snipeit.sh
55
snipeit.sh
|
@ -156,8 +156,8 @@ create_virtualhost () {
|
||||||
create_user () {
|
create_user () {
|
||||||
echo "* Creating Snipe-IT user."
|
echo "* Creating Snipe-IT user."
|
||||||
|
|
||||||
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == "raspbian" ] ; then
|
if [[ "$distro" == "ubuntu" ]] || [[ "$distro" == "debian" ]] || [[ "$distro" == "raspbian" ]] ; then
|
||||||
adduser --quiet --disabled-password --gecos '""' "$APP_USER"
|
adduser --quiet --disabled-password --gecos 'Snipe-IT User' "$APP_USER"
|
||||||
else
|
else
|
||||||
adduser "$APP_USER"
|
adduser "$APP_USER"
|
||||||
fi
|
fi
|
||||||
|
@ -265,7 +265,13 @@ set_hosts () {
|
||||||
echo >> /etc/hosts "127.0.0.1 $(hostname) $fqdn"
|
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 ]]; then
|
||||||
distro="$(lsb_release -is)"
|
distro="$(lsb_release -is)"
|
||||||
version="$(lsb_release -rs)"
|
version="$(lsb_release -rs)"
|
||||||
codename="$(lsb_release -cs)"
|
codename="$(lsb_release -cs)"
|
||||||
|
@ -311,7 +317,7 @@ case $distro in
|
||||||
apache_group=www-data
|
apache_group=www-data
|
||||||
apachefile=/etc/apache2/sites-available/$APP_NAME.conf
|
apachefile=/etc/apache2/sites-available/$APP_NAME.conf
|
||||||
;;
|
;;
|
||||||
*debian*)
|
*Debian|debian*)
|
||||||
echo " The installer has detected $distro version $version codename $codename."
|
echo " The installer has detected $distro version $version codename $codename."
|
||||||
distro=debian
|
distro=debian
|
||||||
apache_group=www-data
|
apache_group=www-data
|
||||||
|
@ -330,7 +336,7 @@ case $distro in
|
||||||
apachefile=/etc/httpd/conf.d/$APP_NAME.conf
|
apachefile=/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
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -368,7 +374,39 @@ done
|
||||||
|
|
||||||
case $distro in
|
case $distro in
|
||||||
debian)
|
debian)
|
||||||
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.x
|
# Install for Debian 9.x
|
||||||
tzone=$(cat /etc/timezone)
|
tzone=$(cat /etc/timezone)
|
||||||
|
|
||||||
|
@ -389,6 +427,7 @@ case $distro in
|
||||||
create_virtualhost
|
create_virtualhost
|
||||||
log "a2enmod rewrite"
|
log "a2enmod rewrite"
|
||||||
log "a2ensite $APP_NAME.conf"
|
log "a2ensite $APP_NAME.conf"
|
||||||
|
rename_default_vhost
|
||||||
|
|
||||||
set_hosts
|
set_hosts
|
||||||
|
|
||||||
|
@ -422,6 +461,7 @@ case $distro in
|
||||||
create_virtualhost
|
create_virtualhost
|
||||||
log "a2enmod rewrite"
|
log "a2enmod rewrite"
|
||||||
log "a2ensite $APP_NAME.conf"
|
log "a2ensite $APP_NAME.conf"
|
||||||
|
rename_default_vhost
|
||||||
|
|
||||||
set_hosts
|
set_hosts
|
||||||
|
|
||||||
|
@ -456,8 +496,7 @@ case $distro in
|
||||||
log "phpenmod mbstring"
|
log "phpenmod mbstring"
|
||||||
log "a2enmod rewrite"
|
log "a2enmod rewrite"
|
||||||
log "a2ensite $APP_NAME.conf"
|
log "a2ensite $APP_NAME.conf"
|
||||||
log "mv /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/111-default.conf"
|
rename_default_vhost
|
||||||
log "mv /etc/apache2/sites-enabled/snipeit.conf /etc/apache2/sites-enabled/000-snipeit.conf"
|
|
||||||
|
|
||||||
set_hosts
|
set_hosts
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue