forked from p2p.legal/install_nextcloud
Check system OS for install certbot
This commit is contained in:
parent
adfb14d2b9
commit
79a8057306
17
ssl.sh
17
ssl.sh
|
@ -28,10 +28,23 @@ nonssl(){
|
|||
sed -i '/ssl_certificate/d' /etc/nginx/conf.d/nextcloud.conf
|
||||
}
|
||||
|
||||
|
||||
install_certbot(){
|
||||
sudo apt update
|
||||
if [[ $(grep buster /etc/os-release) ]]; then
|
||||
[[ -z $(cat /etc/apt/sources.list | grep "buster-backports main") ]] && echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
|
||||
apt update
|
||||
apt install certbot python-certbot-nginx -t buster-backports -y
|
||||
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() {
|
||||
|
|
Loading…
Reference in New Issue