Update 'Setup-Repo.sh'
This commit is contained in:
@@ -2,6 +2,22 @@ dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
|
|||||||
dist=$(grep --color=never -Po "^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 '"')
|
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 () {
|
mysql () {
|
||||||
|
|
||||||
Dist=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
Dist=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||||
@@ -24,19 +40,74 @@ fi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init () {
|
|
||||||
|
|
||||||
Dist=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
universe () {
|
||||||
|
|
||||||
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
|
||||||
$PKGI software-properties-common gnupg > $OUTPUT 2>&1
|
add-apt-repository --no-update universe -y -n > $OUTPUT 2>&1
|
||||||
elif [ "$osrel" = "deb10" ]; then
|
|
||||||
$PKGI gnupg > $OUTPUT 2>&1
|
|
||||||
elif [ "$osrel" = "cent8" ]; then
|
|
||||||
$PKGI gnupg
|
|
||||||
fi
|
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
|
$repo
|
||||||
|
|||||||
Reference in New Issue
Block a user