Added support for Debian 12 for PHP,Nginx, Apache and chrome

also fixed repo url for MySQL
This commit is contained in:
2023-07-02 18:47:57 +02:00
parent 952ac6bf16
commit 3ea69543c6

View File

@@ -7,6 +7,7 @@ if [ -z "$osrel" ] ; then
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then osrel=ubu2004;
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then osrel=deb10;
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"11"* ]]; then osrel=deb11;
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"12"* ]]; then osrel=deb12;
elif [ "$(grep -oP '(?<=^PLATFORM_ID=).+' /etc/os-release | tr -d '"')" = "platform:el8" ]; then osrel=el8;
else echo "This distro is not (yet) supported" && exit;
fi
@@ -15,7 +16,7 @@ fi
init () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
apt install -y --no-install-recommends software-properties-common gnupg
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ]; then
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ] || [ "$osrel" = "deb12" ]; then
apt install -y --no-install-recommends gnupg2 apt-transport-https lsb-release ca-certificates curl
elif [ "$osrel" = "el8" ]; then
dnf install --setopt=install_weak_deps=False --best gnupg
@@ -26,8 +27,8 @@ init () {
mysql () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ]; then
curl --retry 7 --retry-delay 5 -s http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql-2022 | gpg --dearmor > /usr/share/keyrings/mysql-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/mysql-archive-keyring.gpg arch=amd64] http://mirror.nxdi.nl/apt/mysql/"$dist"/ "$dist_name" mysql-8.0" >/etc/apt/sources.list.d/mysql.list
curl --retry 7 --retry-delay 5 -s https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | gpg --dearmor > /usr/share/keyrings/mysql-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/mysql-archive-keyring.gpg arch=amd64] http://repo.mysql.com/apt/"$dist"/ "$dist_name" mysql-8.0" >/etc/apt/sources.list.d/mysql.list
elif [ "$osrel" = "el8" ]; then
rpm --import http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql
@@ -79,7 +80,7 @@ epel () {
apache () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
add-apt-repository --no-update ppa:ondrej/apache2 -y -n
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ]; then
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ] || [ "$osrel" = "deb12" ]; then
curl --retry 7 --retry-delay 5 https://packages.sury.org/apache2/apt.gpg -o /usr/share/keyrings/apache2-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/apache2-archive-keyring.gpg] https://packages.sury.org/apache2/ "$dist_name" main" > /etc/apt/sources.list.d/apache2.list
else
@@ -88,7 +89,7 @@ apache () {
}
nginx () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ] ; then
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ] || [ "$osrel" = "deb12" ] ; then
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg arch=amd64] http://nginx.org/packages/"$dist" "$dist_name" nginx" > /etc/apt/sources.list.d/nginx.list
curl --retry 7 --retry-delay 5 -s https://nginx.org/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg
elif [ "$osrel" = "el8" ]; then
@@ -109,7 +110,7 @@ nginx () {
php () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
add-apt-repository --no-update ppa:ondrej/php -y -n
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ]; then
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ] || [ "$osrel" = "deb12" ]; then
curl --retry 7 --retry-delay 5 https://packages.sury.org/php/apt.gpg -o /usr/share/keyrings/php-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/php-archive-keyring.gpg] https://packages.sury.org/php/ "$dist_name" main" > /etc/apt/sources.list.d/php.list
elif [ "$osrel" = "el8" ]; then
@@ -169,7 +170,7 @@ prosody () {
}
GoogleChrome () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ]; then
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ] || [ "$osrel" = "deb12" ]; then
curl -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list
else