sh 我的Automated LetsEncrypt更新程序的第一次修订为ZNC和朋友使用letsencrypt工具

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 我的Automated LetsEncrypt更新程序的第一次修订为ZNC和朋友使用letsencrypt工具相关的知识,希望对你有一定的参考价值。

#!/bin/bash
domain_list="domains.txt"
# format is:
# domain1.abc.com,abc.com
# domain2.xyz.com,test.xyz.com,xyz.com

LEBIN="letsencrypt"
LE="$LEBIN --text certonly --agree-tos --renew-by-default --standalone --standalone-supported-challenges tls-sni-01 "


## Web Server Update

# shutdown server
monit stop nginx
sleep 120
# update domains
cert_domains=$(cat $domain_list|grep -v \#)
for raw_domains in $cert_domains
do
        domains=$(echo $raw_domains | sed -e "s/, / -d /g" -e "s/,/ -d /g")
        echo $LE -d $domains
        sleep 1
done
# start server (hopefully things worked)
monit start nginx
## technically, reload should do it though...

## ZNC Update
# update to fit needs
ZNCSERV="test.abc.com"
ZNCDEST="/etc/znc"
cat /etc/letsencrypt/live/$ZNCSERV/privkey.pem /etc/letsencrypt/live/$ZNCSERV/fullchain.pem > $ZNCDEST/znc.pem
kill -HUP `pidof znc`
## Hope everything worked...

以上是关于sh 我的Automated LetsEncrypt更新程序的第一次修订为ZNC和朋友使用letsencrypt工具的主要内容,如果未能解决你的问题,请参考以下文章

Agile123Automated Test in Agile

Entity Framework Code-First(21):Automated Migration

Automated EBS Snapshots using AWS Lambda & CloudWatch

[UVa10188]Automated Judge Script

AUTOML --- Machine Learning for Automated Algorithm Design.

Automated Front End Test - Xvfb, Chromedriver, Selenium, Jenkins