|
发表于 2024-5-4 16:31:08
|
显示全部楼层
- #!/bin/bash
- # Step 1: Extract domain names and generate SSL certificates
- for file in /www/server/panel/vhost/nginx/*.conf; do
- if [[ $file == *".plus"* || $file == *".org"* || $file == *".com"* || $file == *".sd"* ]]; then
- domain=$(basename "$file" .conf)
-
- # Issue SSL certificate
- if ./acme.sh --issue --dns dns_cf -d $domain --nginx; then
- # If certificate issuance is successful, install the certificate
- ./acme.sh --installcert -d $domain --ecc --key-file /www/server/panel/vhost/cert/$domain/privkey.pem --fullchain-file /www/server/panel/vhost/cert/$domain/fullchain.pem
- else
- echo "Failed to issue certificate for domain $domain. Skipping installation."
- fi
- fi
- done
复制代码
刚刚用gpt写了一个不知道有没有更好的 |
|