From cd2c7ee57ed6966cefbc9b0f156912c53782217a Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Tue, 2 Jan 2024 10:48:53 +0100 Subject: [PATCH] =?utf8?q?Dostosowanie=20addonu=20lampstack=20do=20nowych?= =?utf8?q?=20wymaga=C5=84=20addon=C3=B3w.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- addons/lampstack | 60 +++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 44 deletions(-) diff --git a/addons/lampstack b/addons/lampstack index 4ba3d85..08d7ddf 100644 --- a/addons/lampstack +++ b/addons/lampstack @@ -1,51 +1,23 @@ #!/bin/bash -if [ "$1" ]; then - case $1 in - "install") echo "Installation $(basename $0) addon..."; - baseVersion=$(head -1 /etc/apt/sources.list | awk '{print $3}') +baseVersion=$(head -1 /etc/apt/sources.list | awk '{print $3}') - apt install lsb-release -y; - wget https://dev.mysql.com/get/mysql-apt-config_0.8.25-1_all.deb; - dpkg -i mysql-apt-config_0.8.25-1_all.deb; +apt install lsb-release -y; +wget https://dev.mysql.com/get/mysql-apt-config_0.8.25-1_all.deb; +dpkg -i mysql-apt-config_0.8.25-1_all.deb; - sed -i "s/$baseVersion/bullseye/g" /etc/apt/sources.list; +sed -i "s/$baseVersion/bullseye/g" /etc/apt/sources.list; - apt update; - apt install mysql-server -y - apt-get install --fix-missing - if [ $? -eq 0 ]; then mysqlSuccess=0; else mysqlSuccess=1; fi +apt update; +apt install mysql-server -y +apt-get install --fix-missing +apt-mark hold libmecab2 libssl1.1 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core - apt-mark hold libmecab2 libssl1.1 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core +sed -i "s/bullseye/$baseVersion/g" /etc/apt/sources.list; +apt update +apt install apache2 libapache2-mod-php php php-mysql -y; +apt autoremove; +apt autoclean; +apt clean; - sed -i "s/bullseye/$baseVersion/g" /etc/apt/sources.list; - apt update - apt install apache2 libapache2-mod-php php php-mysql -y; - if [ $? -eq 0 ]; then phpApacheSucces=0; else phpApacheSuccess=1; fi - apt autoremove; - apt autoclean; - apt clean; - apt clean; - - rm mysql-apt-config_0.8.25-1_all.deb; - if [ $((mysqlSuccess * phpApacheSuccess)) -eq 0 ]; then - echo "Installation $(basename $0) addon...[ OK ]"; - fi;; - "remove") echo "Removing $(basename $0) addon..."; - apt-mark unhold libmecab2 libssl1.1 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core - - apt-get remove -y libssl1.1 mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core apache2 libapache2-mod-php php php-mysql mysql-apt-config - if [ $? -eq 0 ]; then success=0; else success=1; fi - apt-get upgrade -y libmecab2 mecab-utils mecab-ipadic mecab-ipadic-utf8; - - apt-get autoclean - apt-get autoremove -y - apt-get clean - if [ $success -eq 0 ]; then - echo "Removing $(basename $0) addon...[ OK ]"; - fi;; - esac -else - echo "Internal error: action must be given."; - exit 1; -fi +rm mysql-apt-config_0.8.25-1_all.deb; -- 2.39.5