forked from p2p.legal/install_nextcloud
Check system OS for install certbot
This commit is contained in:
parent
adfb14d2b9
commit
79a8057306
19
ssl.sh
19
ssl.sh
|
@ -28,10 +28,23 @@ nonssl(){
|
||||||
sed -i '/ssl_certificate/d' /etc/nginx/conf.d/nextcloud.conf
|
sed -i '/ssl_certificate/d' /etc/nginx/conf.d/nextcloud.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
install_certbot(){
|
install_certbot(){
|
||||||
[[ -z $(cat /etc/apt/sources.list | grep "buster-backports main") ]] && echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
|
sudo apt update
|
||||||
apt update
|
if [[ $(grep buster /etc/os-release) ]]; then
|
||||||
apt install certbot python-certbot-nginx -t buster-backports -y
|
[[ -z $(cat /etc/apt/sources.list | grep "buster-backports main") ]] && echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
|
||||||
|
sudo apt install certbot python-certbot-nginx -t buster-backports -y
|
||||||
|
elif [[ $(grep stretch /etc/os-release) ]]; then
|
||||||
|
sudo apt install certbot python-certbot-nginx -y
|
||||||
|
elif [[ $(grep -E '16.|17.|18.|19.' /etc/os-release) ]]; then
|
||||||
|
sudo apt install software-properties-common
|
||||||
|
sudo add-apt-repository universe
|
||||||
|
sudo add-apt-repository ppa:certbot/certbot
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install certbot python-certbot-nginx
|
||||||
|
else
|
||||||
|
echo "OS non supporté pour certbot." && exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
create_certificate() {
|
create_certificate() {
|
||||||
|
|
Loading…
Reference in New Issue