This repository has been archived on 2023-05-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
MySQL-DEV/preconf.sh
2020-04-30 11:15:53 +02:00

21 lines
1.1 KiB
Bash

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)"
Dist=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
DistVersion=$(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')
wget -qO - http://repo.mysql.com/RPM-GPG-KEY-mysql | apt-key add -
echo "deb http://repo.mysql.com/apt/"$Dist"/ "$DistVersion" mysql-8.0" >/etc/apt/sources.list.d/mysql.list
$PKGM update
if [ -z ${CurDebFrond+x} ]; then unset DEBIAN_FRONTEND ; else export DEBIAN_FRONTEND=$CurDebFrond; fi #Restore DEBIAN_FRONTEND
unset mrepo
unset mbranch