5k差不多就行了 一个certbot的东西给你整这么复杂,欢迎观看5k脚本: [ol]install_ssltls() { docker stop nginx > /dev/null 2>&1 iptables_open > /dev/null 2>&1 cd ~ certbot_version=$(certbot --version 2>&1 | grep -oP "\d+\.\d+\.\d+") version_ge() { [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" != "$1" ] } if version_ge "$certbot_version" "1.17.0"; then certbot certonly --standalone -d $** --email [email protected] --agree-tos --no-eff-email --force-renewal --key-type ecdsa else certbot certonly --standalone -d $** --email [email protected] --agree-tos --no-eff-email --force-renewal fi cp /etc/letsencrypt/live/$**/fullchain.pem /home/web/certs/${**}_cert.pem > /dev/null 2>&1 cp /etc/letsencrypt/live/$**/privkey.pem /home/web/certs/${**}_key.pem > /dev/null 2>&1 docker start nginx > /dev/null 2>&1 } install_ssltls_text() { echo -e "${huang}$** 公钥信息${bai}" cat /etc/letsencrypt/live/$**/fullchain.pem echo "" echo -e "${huang}$** 私钥信息${bai}" cat /etc/letsencrypt/live/$**/privkey.pem echo "" echo -e "${huang}证书存放路径${bai}" echo "公钥: /etc/letsencrypt/live/$**/fullchain.pem" echo "私钥: /etc/letsencrypt/live/$**/privkey.pem" echo "" } [/ol]复制代码