nginx mainline

Now we can install mainline or stable versions of nginx.
This commit is contained in:
Cristhian Martínez Ochoa 2018-04-03 14:27:58 -05:00
parent 231eb61541
commit ab654a0b7b
2 changed files with 15 additions and 3 deletions

View file

@ -119,7 +119,13 @@ messagend_install() {
nginx_install() {
echo | sudo add-apt-repository ppa:nginx/stable
if [[ ($(conf_read nginx-ppa) == "mainline" || $value == "mainline") && $value != "stable" ]]; then
echo | sudo add-apt-repository ppa:nginx/development
conf_write nginx-ppa mainline
else
echo | sudo add-apt-repository ppa:nginx/stable
conf_write nginx-ppa stable
fi
pre_install
sudo apt-get -y install nginx

View file

@ -12,7 +12,7 @@ arg="$2"
# Check if user entered arg before option and correct it.
if [[ $opt == "-purge" || $opt == "-notools" ]]; then
if [[ $opt == "-purge" || $opt == "-notools" || $opt == "-noptim" ]]; then
opt="$2"
arg="$1"
fi
@ -29,6 +29,12 @@ if [[ $arg == "-purge=force" || $opt == "-purge-server-all=force" || $opt == "-p
force="1"
fi
# Extract value if exist
if [[ $opt == "-nginx="* || $opt == "-html="* || $opt == "-lemp="* ]]; then
value=$(echo "${opt}" | cut -d'=' -f 2 -s)
opt=$(echo "${opt}" | cut -d'=' -f 1 -s)
fi
# LEMP without Optimization for testing purpose (just packages)!
if [[ $arg == "-noptim" && $opt == "-lemp" ]]; then
@ -86,7 +92,7 @@ elif [[ $arg == "-purge" && ( $opt == "-html" || $opt == "-nginx" ) ]]; then
sudo service nginx stop
sudo apt-get -y purge nginx nginx-common
sudo apt-get -y purge letsencrypt python-boto duplicity duply
echo | sudo add-apt-repository --remove 'ppa:nginx/stable'
[[ $(conf_read nginx-ppa) == "mainline" ]] && echo | sudo add-apt-repository --remove 'ppa:nginx/development' || echo | sudo add-apt-repository --remove 'ppa:nginx/stable'
sudo apt-get -y autoremove
sudo rm $HOME/www
sudo rm $HOME/sites-available