Check distro name
Check distro name before Webinoly and MariaDB installation.
This commit is contained in:
parent
76dc09dd9b
commit
4d4a34cfb0
27
lib/general
27
lib/general
|
@ -69,11 +69,32 @@ db_delete() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
check_osname() {
|
||||||
|
local distr=`echo $(lsb_release -i | cut -d':' -f 2)`
|
||||||
|
local osver=`echo $(lsb_release -c | cut -d':' -f 2)`
|
||||||
|
if ! [[ $distr == "Ubuntu" && $osver =~ ^(trusty|xenial|zesty|artful)$ ]]; then
|
||||||
|
echo "${red}" >&2
|
||||||
|
echo "****************************************************************************" >&2
|
||||||
|
echo "**** This OS is not supported by Webinoly and could not work properly ****" >&2
|
||||||
|
echo "****************************************************************************" >&2
|
||||||
|
echo "${end}" >&2
|
||||||
|
fi
|
||||||
|
echo $osver
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
mysql_client_install() {
|
mysql_client_install() {
|
||||||
# Install alternative repos for MariaDB
|
local osname=$(check_osname)
|
||||||
sudo apt-get -y install software-properties-common
|
# Cases with MariaDB v10.2 support
|
||||||
|
case "$osname" in
|
||||||
|
"trusty")
|
||||||
|
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
|
||||||
|
;;
|
||||||
|
"xenial"|"zesty"|"artful")
|
||||||
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
|
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
|
||||||
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.syringanetworks.net/mariadb/repo/10.2/ubuntu xenial main'
|
;;
|
||||||
|
esac
|
||||||
|
sudo add-apt-repository "deb [arch=amd64,i386,ppc64el] http://mirrors.syringanetworks.net/mariadb/repo/10.2/ubuntu $osname main"
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install mariadb-client
|
sudo apt-get -y install mariadb-client
|
||||||
conf_write mysql-client true
|
conf_write mysql-client true
|
||||||
|
|
|
@ -137,7 +137,7 @@ php_install() {
|
||||||
sudo apt-get install -y language-pack-en-base
|
sudo apt-get install -y language-pack-en-base
|
||||||
sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
|
sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install php${ver}-fpm php${ver}-curl php${ver}-gd php${ver}-imap php${ver}-mcrypt php${ver}-readline php${ver}-common php${ver}-recode php${ver}-mysql php${ver}-cli php${ver}-mbstring php${ver}-bcmath php${ver}-mysql php${ver}-opcache php${ver}-zip php${ver}-xml php-imagick graphviz php-pear php-xdebug php-msgpack php${ver}-soap unzip pwgen
|
sudo apt-get -y install php${ver}-fpm php${ver}-curl php${ver}-gd php${ver}-imap php${ver}-mcrypt php${ver}-readline php${ver}-common php${ver}-recode php${ver}-mysql php${ver}-cli php${ver}-mbstring php${ver}-bcmath php${ver}-mysql php${ver}-opcache php${ver}-zip php${ver}-xml php-imagick graphviz php-pear php-xdebug php-msgpack php${ver}-soap
|
||||||
|
|
||||||
sudo cp /etc/php/$(conf_read php-ver)/fpm/php.ini /opt/webinoly/templates/source/
|
sudo cp /etc/php/$(conf_read php-ver)/fpm/php.ini /opt/webinoly/templates/source/
|
||||||
sudo cp /etc/php/$(conf_read php-ver)/fpm/pool.d/www.conf /opt/webinoly/templates/source/
|
sudo cp /etc/php/$(conf_read php-ver)/fpm/pool.d/www.conf /opt/webinoly/templates/source/
|
||||||
|
@ -152,7 +152,7 @@ mysql_install() {
|
||||||
mysql_client_install
|
mysql_client_install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# debconf-utils for unattended scripts && pwgen to generate random strings (passwords)
|
# debconf-utils for unattended scripts
|
||||||
# debconf-get-selections | grep phpmyadmin <<-- list conf variables
|
# debconf-get-selections | grep phpmyadmin <<-- list conf variables
|
||||||
sudo apt-get -y install debconf-utils
|
sudo apt-get -y install debconf-utils
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ elif [[ $arg == "-purge" && $opt == "-php" ]]; then
|
||||||
stack -pma -purge
|
stack -pma -purge
|
||||||
fi
|
fi
|
||||||
sudo service php*-fpm stop
|
sudo service php*-fpm stop
|
||||||
sudo apt-get -y purge php*-fpm php*-curl php*-gd php*-imap php*-mcrypt php*-readline php*-common php*-recode php*-mysql php*-cli php*-mbstring php*-bcmath php*-mysql php*-opcache php*-zip php*-xml php*-soap php-imagick graphviz php-pear php-xdebug php-msgpack unzip
|
sudo apt-get -y purge php*-fpm php*-curl php*-gd php*-imap php*-mcrypt php*-readline php*-common php*-recode php*-mysql php*-cli php*-mbstring php*-bcmath php*-mysql php*-opcache php*-zip php*-xml php*-soap php-imagick graphviz php-pear php-xdebug php-msgpack
|
||||||
sudo apt-get -y purge php-memcached php-memcache memcached
|
sudo apt-get -y purge php-memcached php-memcache memcached
|
||||||
sudo apt-get -y purge redis-server php-redis postfix
|
sudo apt-get -y purge redis-server php-redis postfix
|
||||||
echo | sudo add-apt-repository --remove 'ppa:ondrej/php'
|
echo | sudo add-apt-repository --remove 'ppa:ondrej/php'
|
||||||
|
@ -176,7 +176,7 @@ elif [[ $arg == "-purge" && $opt == "-mysql" ]]; then
|
||||||
sudo apt-get -y purge mariadb-server mariadb-common mysql-common debconf-utils
|
sudo apt-get -y purge mariadb-server mariadb-common mysql-common debconf-utils
|
||||||
sudo apt-get -y purge mariadb-client
|
sudo apt-get -y purge mariadb-client
|
||||||
sudo apt-get -y autoremove
|
sudo apt-get -y autoremove
|
||||||
sudo add-apt-repository --remove 'deb [arch=amd64,i386,ppc64el] http://mirrors.syringanetworks.net/mariadb/repo/10.2/ubuntu xenial main'
|
sudo add-apt-repository --remove "deb [arch=amd64,i386,ppc64el] http://mirrors.syringanetworks.net/mariadb/repo/10.2/ubuntu $(check_osname) main"
|
||||||
sudo rm -rf /etc/mysql
|
sudo rm -rf /etc/mysql
|
||||||
sudo rm -rf /var/lib/mysql
|
sudo rm -rf /var/lib/mysql
|
||||||
conf_delete mysql-root
|
conf_delete mysql-root
|
||||||
|
|
16
weby
16
weby
|
@ -4,6 +4,20 @@
|
||||||
# This script is designed to install latest Webinoly.
|
# This script is designed to install latest Webinoly.
|
||||||
webyversion="1.1.0-beta"
|
webyversion="1.1.0-beta"
|
||||||
|
|
||||||
|
|
||||||
|
# Check OS support
|
||||||
|
distr=`echo $(lsb_release -i | cut -d':' -f 2)`
|
||||||
|
osver=`echo $(lsb_release -c | cut -d':' -f 2)`
|
||||||
|
if ! [[ $distr == "Ubuntu" && $osver =~ ^(xenial)$ ]]; then
|
||||||
|
echo "$(tput setaf 1)"
|
||||||
|
echo "****************************************************************************"
|
||||||
|
echo "**** This OS is not supported by Webinoly and could not work properly ****"
|
||||||
|
echo "****************************************************************************"
|
||||||
|
echo "$(tput sgr0)"
|
||||||
|
read -p "Press [Enter] key to continue..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ -n "$1" ]]; then
|
if [[ -n "$1" ]]; then
|
||||||
setup="$1"
|
setup="$1"
|
||||||
else
|
else
|
||||||
|
@ -67,7 +81,7 @@ conf_write app-version $webyversion
|
||||||
|
|
||||||
# Check for missing essential packages
|
# Check for missing essential packages
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
sudo apt-get -y -qq install software-properties-common python-software-properties
|
sudo apt-get -y -qq install software-properties-common python-software-properties pwgen unzip
|
||||||
|
|
||||||
|
|
||||||
# NGINX Installation
|
# NGINX Installation
|
||||||
|
|
Loading…
Reference in a new issue