Skip to content

Commit

Permalink
pre-packs and ppa remove
Browse files Browse the repository at this point in the history
Basic packages are now installed before stack.
Redis PPA, MariaDB apt-key should be removed when purge or uninstall.
  • Loading branch information
QROkes committed Dec 5, 2017
1 parent ed9b5b2 commit c0d3752
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
12 changes: 11 additions & 1 deletion lib/general
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ check_osname() {
}


pre_install() {
sudo apt-get -qq update
if [[ $(conf_read pre-packs) != true ]]; then
# Check for missing essential packages
sudo apt-get -y -qq install software-properties-common python-software-properties pwgen unzip
conf_write pre-packs true
fi
}


mysql_client_install() {
local osname=$(check_osname)
# Cases with MariaDB v10.2 support
Expand All @@ -95,7 +105,7 @@ mysql_client_install() {
;;
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
pre_install
sudo apt-get -y install mariadb-client
conf_write mysql-client true
echo "${gre}MySQL Client has been successfully installed!${end}"
Expand Down
10 changes: 6 additions & 4 deletions lib/install
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ messagend_install() {

nginx_install() {
echo | sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
pre_install
sudo apt-get -y install nginx

if [[ $(conf_read login-www-data) == "true" ]]; then
Expand All @@ -136,7 +136,7 @@ php_install() {
# Fix ondrej issue - https://github.com/oerdnj/deb.sury.org/issues/56
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
sudo apt-get update
pre_install
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/
Expand All @@ -152,6 +152,7 @@ mysql_install() {
mysql_client_install
fi

pre_install
# debconf-utils for unattended scripts
# debconf-get-selections | grep phpmyadmin <<-- list conf variables
sudo apt-get -y install debconf-utils
Expand Down Expand Up @@ -290,7 +291,7 @@ nginx_tool() {
fi

# Instalar Duply & Duplicity
sudo apt-get update
pre_install
sudo apt-get -y install python-boto duplicity duply

# Install LetsEncrypt
Expand Down Expand Up @@ -325,7 +326,7 @@ php_tool() {

# Redis (Object Cache)
echo | sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get update
pre_install
sudo apt-get -y install redis-server php-redis

# Memcached (Object Cache)
Expand All @@ -350,6 +351,7 @@ mysql_tool() {
echo "phpmyadmin phpmyadmin/app-password-confirm password $AUTOGENPASS_PMA" | debconf-set-selections

#PhpMyAdmin Installation
pre_install
sudo apt-get -y install phpmyadmin

if [[ -d /usr/share/phpmyadmin ]]; then
Expand Down
15 changes: 14 additions & 1 deletion plugins/stack
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ elif [[ $arg == "-purge" && $opt == "-php" ]]; then
sudo apt-get -y purge php-memcached php-memcache memcached
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:chris-lea/redis-server'
sudo apt-get -y autoremove
sudo rm -rf /etc/php
sudo rm /opt/webinoly/templates/source/*
Expand Down Expand Up @@ -176,7 +177,19 @@ 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-client
sudo apt-get -y autoremove
sudo add-apt-repository --remove "deb [arch=amd64,i386,ppc64el] http://mirrors.syringanetworks.net/mariadb/repo/10.2/ubuntu $(check_osname) main"

os_name=$(check_osname)
sudo add-apt-repository --remove "deb [arch=amd64,i386,ppc64el] http://mirrors.syringanetworks.net/mariadb/repo/10.2/ubuntu ${os_name} main"
# Cases with MariaDB v10.2 support
case "$os_name" in
"trusty")
sudo apt-key del 0xcbcb082a1bb943db
;;
"xenial"|"zesty"|"artful")
sudo apt-key del 0xF1656F24C74CD1D8
;;
esac

sudo rm -rf /etc/mysql
sudo rm -rf /var/lib/mysql
conf_delete mysql-root
Expand Down
5 changes: 5 additions & 0 deletions plugins/webinoly
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ elif [ "$opt" == "-uninstall" ]; then
if [[ $(conf_read linux-optim) == "purged" ]]; then
swap_delete
fi
if [[ $(conf_read pre-packs) == true ]]; then
sudo apt-get -y -qq purge pwgen unzip
sudo apt-get -y -qq autoremove
conf_write pre-packs purged
fi
sudo rm -rf /opt/webinoly
sudo rm /usr/bin/webinoly
sudo rm /usr/bin/stack
Expand Down
6 changes: 1 addition & 5 deletions weby
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Webinoly script.
# This script is designed to install latest Webinoly.
webyversion="1.1.0-beta"
webyversion="1.1.0"


# Check OS support
Expand Down Expand Up @@ -79,10 +79,6 @@ fi
# Write app version
conf_write app-version $webyversion

# Check for missing essential packages
sudo apt-get -qq update
sudo apt-get -y -qq install software-properties-common python-software-properties pwgen unzip


# NGINX Installation
if [[ $setup -gt 0 && $setup != 4 ]]; then
Expand Down

0 comments on commit c0d3752

Please sign in to comment.