Fixed inconsistency in vars

This commit is contained in:
2020-09-25 14:22:33 +02:00
parent ba831bd106
commit 05c6bbb37d
3 changed files with 23 additions and 14 deletions

View File

@@ -69,7 +69,7 @@ repo=https://git.ictmaatwerk.com/VPS-scripts/MySQL
branch=master branch=master
###Select Module type ###Select Module type
mtype=""$mrepo"/raw/branch/"$mbranch"" mtype=""$repo"/raw/branch/"$branch""
#SelfBuilding Vars #SelfBuilding Vars
PKGI="${PKGM} install -y" PKGI="${PKGM} install -y"
@@ -96,7 +96,7 @@ fi
##--------------------------## ##--------------------------##
msg "Starting installer." 8 78 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 $PKGI curl > $OUTPUT 2>&1

13
conf.sh
View File

@@ -3,19 +3,22 @@ mrepo=https://git.ictmaatwerk.com/VPS-scripts/MySQL
mbranch=master mbranch=master
if [ -z ${PHPMyadmin+x} ]; then echo 'Error $PHPMyadmin is not set, Setting default OFF' && PHPMyadmin=0;fi #check if Var is set 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 rm -rf /etc/mysql/ /etc/my.cnf.d/ /etc/my.cnf
mkdir /etc/mysql/ mkdir /etc/mysql/
wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/config/MySQL/mysqld-V8.cnf -O /etc/mysql/my.cnf 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 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 sed -i 's#MySQLlog#/var/log/mysqld.log#g' /etc/mysql/my.cnf
fi fi
systemctl start mysql systemctl start $MYSQLSNAME
systemctl enable mysql systemctl enable $MYSQLSNAME
if [ $PHPMyadmin = 1 ]; then if [ $PHPMyadmin = 1 ]; then

View File

@@ -1,16 +1,22 @@
mrepo=https://git.ictmaatwerk.com/VPS-scripts/MySQL mrepo=https://git.ictmaatwerk.com/VPS-scripts/MySQL
mbranch=master mbranch=master
if [ -z ${password+x} ]; then echo 'Error $password is not set'; fi
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 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 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/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-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)" 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 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 mrepo
unset mbranch unset mbranch