added error messages
This commit is contained in:
@@ -7,7 +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}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then osrel=cent8;
|
||||
else exit;
|
||||
else echo "This distro is not (yet) supported" && exit;
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -18,6 +18,8 @@ init () {
|
||||
apt install -y --no-install-recommends gnupg2 apt-transport-https lsb-release ca-certificates curl
|
||||
elif [ "$osrel" = "cent8" ]; then
|
||||
dnf install --setopt=install_weak_deps=False --best gnupg
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -36,12 +38,16 @@ mysql () {
|
||||
echo "gpgkey=http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql" >> /etc/yum.repos.d/mysql.repo
|
||||
|
||||
dnf -y module disable mysql
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
universe () {
|
||||
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
||||
add-apt-repository --no-update universe -y -n
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -49,6 +55,8 @@ 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
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -58,6 +66,8 @@ apache () {
|
||||
elif [ "$osrel" = "deb10" ]; then
|
||||
curl --retry 7 --retry-delay 5 -s https://packages.sury.org/apache2/apt.gpg -o /etc/apt/trusted.gpg.d/apache2.gpg
|
||||
echo "deb https://packages.sury.org/apache2/ "$dist_name" main" > /etc/apt/sources.list.d/apache2.list
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -75,6 +85,8 @@ nginx () {
|
||||
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
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -84,19 +96,25 @@ php () {
|
||||
elif [ "$osrel" = "deb10" ]; then
|
||||
curl --retry 7 --retry-delay 5 -s https://packages.sury.org/php/apt.gpg -o /etc/apt/trusted.gpg.d/php.gpg
|
||||
echo "deb https://packages.sury.org/php/ "$dist_name" main" > /etc/apt/sources.list.d/php.list
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
certbot () {
|
||||
if [ "$osrel" = "ubu1804" ] ; then
|
||||
add-apt-repository --no-update ppa:certbot/certbot -y -n
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
redis () {
|
||||
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
||||
add-apt-repository --no-update ppa:chris-lea/redis-server -y -n
|
||||
else
|
||||
echo "$repo repository not available for this Distro"
|
||||
fi
|
||||
}
|
||||
|
||||
$repo
|
||||
type $repo &>/dev/null && $repo || echo "Repository $repo not found."
|
||||
|
||||
Reference in New Issue
Block a user