Correct web server check
This commit is contained in:
parent
814f854040
commit
78072dcce7
@ -21,19 +21,14 @@ for vhost in ${domains[@]}; do # for each vhost
|
||||
((index++))
|
||||
|
||||
[ ! -d "$certdir[$index]" ] && # if there is no certificate for the domain
|
||||
case "$(netstat -tulpn | grep ":80\s")" in
|
||||
*nginx*) # if nginx is running
|
||||
if [ systemctl is-active --quiet nginx ]
|
||||
then
|
||||
pacman -S --noconfirm python3-certbot-nginx
|
||||
certbot -d "$vhost" certonly --nginx --register-unsafely-without-email --agree-tos # request cert with nginx
|
||||
;;
|
||||
#*apache*) # if apache is running
|
||||
# pacman -S --noconfirm python3-certbot-apache
|
||||
# certbot -d "$vhost" certonly --apache --register-unsafely-without-email --agree-tos # request cert with apache
|
||||
# ;;
|
||||
*) # otherwise
|
||||
else
|
||||
pacman -S --noconfirm certbot
|
||||
certbot -d "$vhost" certonly --standalone --register-unsafely-without-email --agree-tos # request cert with certbot
|
||||
;;
|
||||
fi
|
||||
esac
|
||||
|
||||
[ ! -d "$certdir[$index]" ] && echo "Error locating or installing SSL certificate." && exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user