diff --git a/conf.sh b/conf.sh index a30f235..d2b09aa 100644 --- a/conf.sh +++ b/conf.sh @@ -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) diff --git a/preconf.sh b/preconf.sh index 1c48a85..36ff9ee 100644 --- a/preconf.sh +++ b/preconf.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 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 \ No newline at end of file