Add 'Setup-Repo.sh'
This commit is contained in:
43
Setup-Repo.sh
Normal file
43
Setup-Repo.sh
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
|
||||||
|
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
|
||||||
|
dist_name=$(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')
|
||||||
|
|
||||||
|
mysql () {
|
||||||
|
|
||||||
|
Dist=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||||
|
|
||||||
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ]; then
|
||||||
|
wget -qO - http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql | apt-key add -
|
||||||
|
echo "deb http://mirror.nxdi.nl/apt/mysql/"$dist"/ "$dist_name" mysql-8.0" >/etc/apt/sources.list.d/mysql.list
|
||||||
|
elif [ "$osrel" = "cent8" ]; then
|
||||||
|
rpm --import http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql
|
||||||
|
|
||||||
|
echo "[mysql80-community]" > /etc/yum.repos.d/mysql.repo
|
||||||
|
echo "name=MySQL 8.0 Community Server" >> /etc/yum.repos.d/mysql.repo
|
||||||
|
echo 'baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/8/$basearch/' >> /etc/yum.repos.d/mysql.repo
|
||||||
|
echo "enabled=1" >> /etc/yum.repos.d/mysql.repo
|
||||||
|
echo "gpgcheck=1" >> /etc/yum.repos.d/mysql.repo
|
||||||
|
echo "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql" >> /etc/yum.repos.d/mysql.repo
|
||||||
|
|
||||||
|
dnf -y module disable mysql
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
init () {
|
||||||
|
|
||||||
|
Dist=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||||
|
|
||||||
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
||||||
|
$PKGI software-properties-common gnupg > $OUTPUT 2>&1
|
||||||
|
elif [ "$osrel" = "deb10" ]; then
|
||||||
|
$PKGI gnupg > $OUTPUT 2>&1
|
||||||
|
fi
|
||||||
|
elif [ "$osrel" = "cent8" ]; then
|
||||||
|
$PKGI gnupg
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$repo
|
||||||
Reference in New Issue
Block a user