From 05c6bbb37d45a783c7344b6cb4f219204b136520 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Fri, 25 Sep 2020 14:22:33 +0200 Subject: [PATCH] Fixed inconsistency in vars --- MySQL-ModInst.sh | 4 ++-- conf.sh | 13 ++++++++----- preconf.sh | 20 +++++++++++++------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/MySQL-ModInst.sh b/MySQL-ModInst.sh index e39ab4d..fd08171 100644 --- a/MySQL-ModInst.sh +++ b/MySQL-ModInst.sh @@ -69,7 +69,7 @@ repo=https://git.ictmaatwerk.com/VPS-scripts/MySQL branch=master ###Select Module type -mtype=""$mrepo"/raw/branch/"$mbranch"" +mtype=""$repo"/raw/branch/"$branch"" #SelfBuilding Vars PKGI="${PKGM} install -y" @@ -96,7 +96,7 @@ fi ##--------------------------## msg "Starting installer." 8 78 -$PKGM update -y > $OUTPUT 2>&1 +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1 $PKGI curl > $OUTPUT 2>&1 diff --git a/conf.sh b/conf.sh index e659b9b..a30f235 100644 --- a/conf.sh +++ b/conf.sh @@ -3,19 +3,22 @@ mrepo=https://git.ictmaatwerk.com/VPS-scripts/MySQL mbranch=master if [ -z ${PHPMyadmin+x} ]; then echo 'Error $PHPMyadmin is not set, Setting default OFF' && PHPMyadmin=0;fi #check if Var is set -systemctl stop mysql rm -rf /etc/mysql/ /etc/my.cnf.d/ /etc/my.cnf mkdir /etc/mysql/ wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/config/MySQL/mysqld-V8.cnf -O /etc/mysql/my.cnf -if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then +if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then + MYSQLSNAME=mysql + systemctl stop $MYSQLSNAME sed -i 's#MySQLlog#/var/log/mysql/error.log#g' /etc/mysql/my.cnf -elif [ "$osrel" = "cent8" ]; then +elif [ "$shortdist" = "cent8" ]; then + systemctl stop $MYSQLSNAME + MYSQLSNAME=mysqld sed -i 's#MySQLlog#/var/log/mysqld.log#g' /etc/mysql/my.cnf fi -systemctl start mysql -systemctl enable mysql +systemctl start $MYSQLSNAME +systemctl enable $MYSQLSNAME if [ $PHPMyadmin = 1 ]; then diff --git a/preconf.sh b/preconf.sh index cb5a88e..1c48a85 100644 --- a/preconf.sh +++ b/preconf.sh @@ -1,16 +1,22 @@ mrepo=https://git.ictmaatwerk.com/VPS-scripts/MySQL mbranch=master -if [ -z ${DEBIAN_FRONTEND+x} ]; then echo 'dpkg env not set' ; else CurDebFrond="$DEBIAN_FRONTEND"; fi #checking and saving DEBIAN_FRONTEND -export DEBIAN_FRONTEND=noninteractive - if [ -z ${password+x} ]; then echo 'Error $password is not set'; fi -debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password $password" -debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password $password" -debconf-set-selections <<< "mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)" +if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then + if [ -z ${DEBIAN_FRONTEND+x} ]; then echo 'dpkg env not set' ; else CurDebFrond="$DEBIAN_FRONTEND"; fi #checking and saving DEBIAN_FRONTEND + export DEBIAN_FRONTEND=noninteractive + + debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password $password" + debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password $password" + debconf-set-selections <<< "mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)" + + if [ -z ${CurDebFrond+x} ]; then unset DEBIAN_FRONTEND ; else export DEBIAN_FRONTEND=$CurDebFrond; fi #Restore DEBIAN_FRONTEND +fi + + curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=mysql osrel=$shortdist bash -if [ -z ${CurDebFrond+x} ]; then unset DEBIAN_FRONTEND ; else export DEBIAN_FRONTEND=$CurDebFrond; fi #Restore DEBIAN_FRONTEND + unset mrepo unset mbranch \ No newline at end of file