114 lines
3.9 KiB
Bash
114 lines
3.9 KiB
Bash
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 '"')
|
|
|
|
|
|
|
|
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 gnupg2 apt-transport-https lsb-release ca-certificates curl > $OUTPUT 2>&1
|
|
elif [ "$osrel" = "cent8" ]; then
|
|
$PKGI gnupg
|
|
fi
|
|
}
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
universe () {
|
|
|
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
|
add-apt-repository --no-update universe -y -n > $OUTPUT 2>&1
|
|
fi
|
|
}
|
|
|
|
epel () {
|
|
|
|
if [ "$osrel" = "cent8" ] ; then
|
|
$PKGI https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
|
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
|
|
fi
|
|
}
|
|
|
|
apache () {
|
|
|
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
|
add-apt-repository --no-update ppa:ondrej/apache2 -y -n > $OUTPUT 2>&1
|
|
elif [ "$osrel" = "deb10" ]; then
|
|
wget -O /etc/apt/trusted.gpg.d/apache2.gpg https://packages.sury.org/apache2/apt.gpg
|
|
echo "deb https://packages.sury.org/apache2/ `lsb_release -cs` main" > /etc/apt/sources.list.d/apache2.list
|
|
fi
|
|
}
|
|
|
|
nginx () {
|
|
|
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
|
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
|
|
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
|
|
elif [ "$osrel" = "deb10" ]; then
|
|
echo "deb http://nginx.org/packages/debian `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
|
|
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
|
|
elif [ "$osrel" = "cent8" ]; then
|
|
rpm --import https://nginx.org/keys/nginx_signing.key
|
|
|
|
echo '[nginx-stable]' >> /etc/yum.repos.d/nginx.repo
|
|
echo 'name=nginx stable repo' >> /etc/yum.repos.d/nginx.repo
|
|
echo 'baseurl=http://nginx.org/packages/centos/$releasever/$basearch/' >> /etc/yum.repos.d/nginx.repo
|
|
echo 'gpgcheck=1' >> /etc/yum.repos.d/nginx.repo
|
|
echo 'enabled=1' >> /etc/yum.repos.d/nginx.repo
|
|
echo 'gpgkey=https://nginx.org/keys/nginx_signing.key' >> /etc/yum.repos.d/nginx.repo
|
|
echo 'module_hotfixes=true' >> /etc/yum.repos.d/nginx.repo
|
|
fi
|
|
}
|
|
|
|
php () {
|
|
|
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
|
add-apt-repository --no-update ppa:ondrej/php -y -n > $OUTPUT 2>&1
|
|
elif [ "$osrel" = "deb10" ]; then
|
|
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
|
echo "deb https://packages.sury.org/php/ `lsb_release -cs` main" > /etc/apt/sources.list.d/php.list
|
|
fi
|
|
}
|
|
|
|
certbot () {
|
|
|
|
if [ "$osrel" = "ubu1804" ] ; then
|
|
add-apt-repository --no-update ppa:certbot/certbot -y -n > $OUTPUT 2>&1
|
|
}
|
|
|
|
|
|
certbot () {
|
|
|
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
|
add-apt-repository --no-update ppa:chris-lea/redis-server -y -n > $OUTPUT 2>&1
|
|
fi
|
|
|
|
$repo
|