From f89385a27a9e2a3f5f88b6b1cbd7c3f883a4f435 Mon Sep 17 00:00:00 2001 From: poka Date: Tue, 10 Dec 2019 19:12:41 +0000 Subject: [PATCH] Adapat isntall for stretch and buster only --- .install/3-install_copylaradio.sh | 2 +- .install/4-install_playsms.sh | 34 ++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.install/3-install_copylaradio.sh b/.install/3-install_copylaradio.sh index 804e854..d12e12e 100755 --- a/.install/3-install_copylaradio.sh +++ b/.install/3-install_copylaradio.sh @@ -38,7 +38,7 @@ fi sudo dpkg -i $MY_PATH/libttspico-data.deb sudo dpkg -i $MY_PATH/libttspico0.deb sudo dpkg -i $MY_PATH/libttspico-utils.deb -sudo dpkg -i $MY_PATH/libav-tools.deb || sudo apt --fix-broken install +sudo dpkg -i $MY_PATH/libav-tools.deb || sudo apt --fix-broken install -y rm $MY_PATH/libttspico-data.deb $MY_PATH/libttspico0.deb $MY_PATH/libttspico-utils.deb $MY_PATH/libav-tools.deb diff --git a/.install/4-install_playsms.sh b/.install/4-install_playsms.sh index b41b683..4717c20 100755 --- a/.install/4-install_playsms.sh +++ b/.install/4-install_playsms.sh @@ -9,7 +9,23 @@ echo -e "${c_yellow}Choisissez un nom de domain pour playsms: $c_" read PSMS_DOMAIN sudo apt -y update -sudo apt -y install nginx php7.3-fpm php7.3-gd php7.3-mysql php7.3-curl php7.3-imap php7.3-mbstring php7.3-xml php7.3-cli mariadb-server +if [[ $(grep buster /etc/os-release) ]]; then + sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 + sudo add-apt-repository 'deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.4/debian buster main' + sudo apt -y update + sudo apt -y install software-properties-common nginx php php-common php-fpm php-gd php-mysql php-curl php-imap php-mbstring php-xml php-cli mariadb-server +elif [[ $(grep stretch /etc/os-release) ]]; then + sudo apt -y install lsb-release apt-transport-https ca-certificates + sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg + echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.3.list + sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 + echo -e "deb [arch=amd64,i386,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.4/debian stretch main\ndeb-src http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.4/debian stretch main" > /etc/apt/sources.list.d/mariadb.list + sudo apt -y update + sudo apt -y install software-properties-common dirmngr nginx php7.3 php7.3-common php7.3-fpm php7.3-gd php7.3-mysql php7.3-curl php7.3-imap php7.3-mbstring php7.3-xml php7.3-cli mariadb-server +else + echo "${c_red}Votre système n'est pas pris en charge par ce script d'installation.$c_" + exit 1 +fi ## Create database @@ -21,6 +37,7 @@ if [[ ! $(sudo mysql -e "show databases;" | grep playsms) ]]; then fi ## Clone repo playSMS +[[ -d playsms ]] && sudo rm -rf playsms git clone https://github.com/antonraharja/playSMS.git $MY_PATH/playsms cp $MY_PATH/templates/install-playsms.conf $MY_PATH/playsms/install.conf @@ -31,7 +48,7 @@ sudo chmod u+x $MY_PATH/playsms/install-playsms.sh cd $MY_PATH/playsms sudo ./install-playsms.sh cd $MY_PATH -sudo rm -rf playsms +##kopa sudo rm -rf playsms ## Start playsmsd on boot @@ -61,13 +78,20 @@ manageSSL() { [[ ! $action =~ ^(on|off|certif)$ ]] && echo "Veuillez choisir ssl, nonssl ou certif pour créer un certificat ssl" && exit 1 install_certbot(){ + sudo apt update if [[ $(grep buster /etc/os-release) ]]; then [[ -z $(cat /etc/apt/sources.list | grep "buster-backports main") ]] && echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list - sudo apt update sudo apt install certbot python-certbot-nginx -t buster-backports -y elif [[ $(grep stretch /etc/os-release) ]]; then - sudo apt update sudo apt install certbot python-certbot-nginx -y + elif [[ $(grep -E '16.|17.|18.|19.' /etc/os-release) ]]; then + sudo apt install software-properties-common + sudo add-apt-repository universe + sudo add-apt-repository ppa:certbot/certbot + sudo apt update + sudo apt install certbot python-certbot-nginx + else + echo "OS non supporté pour certbot." && exit 1 fi } @@ -105,7 +129,7 @@ manageSSL() { } echo -e "${c_yellow}playSMS ne fonctionne pas sans certifcat SSL.$c_" -printf "${c_yellow}Voulez activer installer un certificat SSL maintenant pour $PSMS_DOMAIN ? (o/n) $c_" +printf "${c_yellow}Voulez-vous installer et activer un certificat SSL maintenant pour $PSMS_DOMAIN ? (o/n) $c_" read askSSL if [[ $askSSL =~ ^(o|y|yes|oui|Y|O|YES)$ ]]; then manageSSL certif