mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): dns申请证书
parent
f94c9341b5
commit
7c2aaa0293
20
install.sh
20
install.sh
|
@ -208,13 +208,15 @@ initVar() {
|
||||||
|
|
||||||
# dns tls domain
|
# dns tls domain
|
||||||
dnsTLSDomain=
|
dnsTLSDomain=
|
||||||
|
|
||||||
|
#
|
||||||
|
dnsTLSDomainStatus=
|
||||||
}
|
}
|
||||||
|
|
||||||
# 读取tls证书详情
|
# 读取tls证书详情
|
||||||
readAcmeTLS() {
|
readAcmeTLS() {
|
||||||
# todo
|
|
||||||
if [[ -d "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc" && -f "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc/*.${dnsTLSDomain}.key" && -f "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc/*.${dnsTLSDomain}.cer" ]]; then
|
if [[ -d "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc" && -f "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc/*.${dnsTLSDomain}.key" && -f "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc/*.${dnsTLSDomain}.cer" ]]; then
|
||||||
dnsTLSDomain=true
|
dnsTLSDomainStatus=true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# 检测安装方式
|
# 检测安装方式
|
||||||
|
@ -847,6 +849,8 @@ EOF
|
||||||
handleNginx start
|
handleNginx start
|
||||||
checkIP
|
checkIP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
readAcmeTLS
|
||||||
}
|
}
|
||||||
|
|
||||||
# 修改nginx重定向配置
|
# 修改nginx重定向配置
|
||||||
|
@ -1168,6 +1172,7 @@ installTLS() {
|
||||||
|
|
||||||
switchSSLType
|
switchSSLType
|
||||||
customSSLEmail
|
customSSLEmail
|
||||||
|
## todo 添加证书已安装判断
|
||||||
acmeInstallSSL
|
acmeInstallSSL
|
||||||
|
|
||||||
if [[ "${dnsSSLStatus}" == "true" ]]; then
|
if [[ "${dnsSSLStatus}" == "true" ]]; then
|
||||||
|
@ -1363,8 +1368,15 @@ renewalTLS() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "$HOME/.acme.sh/${domain}_ecc" ]] && [[ -f "$HOME/.acme.sh/${domain}_ecc/${domain}.key" ]] && [[ -f "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" ]]; then
|
if [[ -d "$HOME/.acme.sh/${domain}_ecc" && -f "$HOME/.acme.sh/${domain}_ecc/${domain}.key" && -f "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" ]] || [[ "${dnsTLSDomainStatus}" == "true" ]]; then
|
||||||
modifyTime=$(stat "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" | sed -n '7,6p' | awk '{print $2" "$3" "$4" "$5}')
|
modifyTime=
|
||||||
|
|
||||||
|
if [[ "${dnsTLSDomainStatus}" == "true" ]]; then
|
||||||
|
modifyTime=$(stat "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc/*.${dnsTLSDomain}.cer" | sed -n '7,6p' | awk '{print $2" "$3" "$4" "$5}')
|
||||||
|
else
|
||||||
|
modifyTime=$(stat "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" | sed -n '7,6p' | awk '{print $2" "$3" "$4" "$5}')
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
modifyTime=$(date +%s -d "${modifyTime}")
|
modifyTime=$(date +%s -d "${modifyTime}")
|
||||||
currentTime=$(date +%s)
|
currentTime=$(date +%s)
|
||||||
|
|
Loading…
Reference in New Issue