Fixed setting up password Centos and did cleanup

This commit is contained in:
2020-09-25 15:04:17 +02:00
parent 1e38e4ae9e
commit 515852aa9d
2 changed files with 4 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
mrepo=https://git.ictmaatwerk.com/VPS-scripts/MySQL
mbranch=master
if [ -z ${password+x} ]; then echo 'Error $password is not set'; fi
if [ -z ${PHPMyadmin+x} ]; then echo 'Error $PHPMyadmin is not set, Setting default OFF' && PHPMyadmin=0;fi #check if Var is set
rm -rf /etc/mysql/ /etc/my.cnf.d/ /etc/my.cnf
@@ -20,6 +21,9 @@ fi
systemctl start $MYSQLSNAME
systemctl enable $MYSQLSNAME
if [ "$shortdist" = "cent8" ]; then
mysql -u root -p$(awk '/A temporary password is generated for/ {a=$0} END{ print a }' /var/log/mysqld.log | awk '{print $(NF)}') --connect-expired-password -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '$password'";
fi
if [ $PHPMyadmin = 1 ]; then
mkdir -p /usr/share/phpmyadmin/
@@ -46,7 +50,6 @@ if [ $PHPMyadmin = 1 ]; then
mysql -u root --password="$password" < /usr/share/phpmyadmin/sql/create_tables.sql > $OUTPUT 2>&1
fi
#Running Spesific WebPReconf
if curl --output /dev/null --silent --head --fail "$mrepo"/raw/branch/"$mbranch"/"$webserv"-conf.sh; then
source <(curl -s "$mrepo"/raw/branch/"$mbranch"/"$webserv"-conf.sh)

View File

@@ -13,10 +13,7 @@ if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist
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
unset mrepo
unset mbranch