From ab654a0b7b1fed17d18013d655507b7ce7885afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Tue, 3 Apr 2018 14:27:58 -0500 Subject: [PATCH] nginx mainline Now we can install mainline or stable versions of nginx. --- lib/install | 8 +++++++- plugins/stack | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/install b/lib/install index 2e0da17..0fe6c4f 100644 --- a/lib/install +++ b/lib/install @@ -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 diff --git a/plugins/stack b/plugins/stack index f2289b1..1f9e8ee 100644 --- a/plugins/stack +++ b/plugins/stack @@ -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