Fixed setting up password Centos and did cleanup
This commit is contained in:
5
conf.sh
5
conf.sh
@@ -2,6 +2,7 @@
|
|||||||
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 [ -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
|
||||||
|
|
||||||
rm -rf /etc/mysql/ /etc/my.cnf.d/ /etc/my.cnf
|
rm -rf /etc/mysql/ /etc/my.cnf.d/ /etc/my.cnf
|
||||||
@@ -20,6 +21,9 @@ fi
|
|||||||
systemctl start $MYSQLSNAME
|
systemctl start $MYSQLSNAME
|
||||||
systemctl enable $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
|
if [ $PHPMyadmin = 1 ]; then
|
||||||
mkdir -p /usr/share/phpmyadmin/
|
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
|
mysql -u root --password="$password" < /usr/share/phpmyadmin/sql/create_tables.sql > $OUTPUT 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#Running Spesific WebPReconf
|
#Running Spesific WebPReconf
|
||||||
if curl --output /dev/null --silent --head --fail "$mrepo"/raw/branch/"$mbranch"/"$webserv"-conf.sh; then
|
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)
|
source <(curl -s "$mrepo"/raw/branch/"$mbranch"/"$webserv"-conf.sh)
|
||||||
|
|||||||
@@ -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
|
if [ -z ${CurDebFrond+x} ]; then unset DEBIAN_FRONTEND ; else export DEBIAN_FRONTEND=$CurDebFrond; fi #Restore DEBIAN_FRONTEND
|
||||||
fi
|
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
|
||||||
|
|
||||||
|
|
||||||
unset mrepo
|
unset mrepo
|
||||||
unset mbranch
|
unset mbranch
|
||||||
Reference in New Issue
Block a user