Fix and optimize shell and acme

This commit is contained in:
Stille 2021-09-02 10:09:17 +08:00
parent 965ac3dfb4
commit 36f6b484be
3 changed files with 9 additions and 2 deletions

View File

@ -22,6 +22,8 @@ acme (){
cp /acme.sh/${DOMAIN}/fullchain.cer /ssl/${DOMAIN}.cer
cp /acme.sh/${DOMAIN}/${DOMAIN}.key /ssl/${DOMAIN}.key
mv /acme.sh/${DOMAIN} /acme.sh/${DOMAIN}-$(date +%Y)-$(date +%m)-$(date +%d)-${RANDOM}
rm -rf /acme.sh/ca
rm -rf /acme.sh/http.header
}
if [ ! -n "${DOMAIN}" ] ; then
@ -31,5 +33,5 @@ else
fi
cat >/var/spool/cron/crontabs/root<<EOF
0 0 1 * * /conf/acme.sh >/dev/null 2>&1
0 0 3 * * /conf/acme.sh >/dev/null 2>&1
EOF

View File

@ -14,7 +14,7 @@ DOMAIN=$(cat /conf/account.conf | awk -F= '{if($1~"DOMAIN")print $2}')
DNSAPI=$(cat /conf/account.conf | awk -F= '{if($1~"DNSAPI")print $2}')
cat >/var/spool/cron/crontabs/root<<EOF
0 0 1 * * /conf/acme.sh >/dev/null 2>&1
0 0 3 * * /conf/acme.sh >/dev/null 2>&1
EOF
if [ ! -f "/ssl/${DOMAIN}.cer" ] && [ -n "${DOMAIN}" ]; then

View File

@ -361,6 +361,11 @@ if ! type docker-compose >/dev/null 2>&1 ; then
exit 0
fi
if ! type git >/dev/null 2>&1 ; then
echo -e "${Red}本机未安装 git 已退出脚本.${Font}"
exit
fi
if [ -d "${WORK_PATH}/rssforever" ] ; then
echo -e "${Green}当前目录存在 rssforever 项目.请更换目录,或删除后再次执行脚本.${Font}"
exit 0