修复acme

This commit is contained in:
lsy 2024-09-23 01:29:04 +08:00
parent fca495735f
commit 91fdf46def

View File

@ -4,7 +4,7 @@ if [[ ! -d "${HOME}/.acme.sh" ]];then
declare mail declare mail
declare domain declare domain
read -p "请输入用来申请域名的邮箱:" mail read -p "请输入用来申请域名的邮箱:" mail
if [[ $mail =~ "\w+@\w+\.[a-z]+" ]];then if [[ ! $mail =~ "\w+@\w+\.[a-z]+" ]];then
echo "邮箱不合法" echo "邮箱不合法"
exit exit
fi fi
@ -14,11 +14,11 @@ fi
declare domain_str='' declare domain_str=''
echo "请输入需要申请SSL证书的域名" echo "请输入需要申请SSL证书的域名"
while(1);do while(true);do
read -p "不输入退出添加:" domain read -p "不输入退出添加:" domain
if [[ -z $domain ]];then if [[ -z $domain ]];then
break break
elif [[ $domain =~ "\w+\.[a-z]+" ]];then elif [[ ! $domain =~ "[\w+\.]+" ]];then
echo "域名不合法" echo "域名不合法"
exit exit
domain_str="$domain_str -d $domain" domain_str="$domain_str -d $domain"
@ -54,7 +54,7 @@ case $pick_mode in
ehco "${pick}.${mode_arr[$pick]}" ehco "${pick}.${mode_arr[$pick]}"
done done
read -p "请选择验证模式" pick_mode read -p "请选择验证模式" pick_mode
if [[ $pick_mode =~ [1-${pick}] ]]; then if [[ ! $pick_mode =~ [1-${pick}] ]]; then
exit exit
fi fi
@ -79,12 +79,12 @@ case $pick_mode in
declare CF_Key declare CF_Key
declare CF_Email declare CF_Email
read -p "请输入cloudflare的邮箱" CF_Email read -p "请输入cloudflare的邮箱" CF_Email
if [[ $CF_Email =~ "\w+@\w+\.[a-z]+" ]];then if [[ ! $CF_Email =~ "\w+@\w+\.[a-z]+" ]];then
echo "邮箱不合法" echo "邮箱不合法"
exit exit
fi fi
read -p "请输入cloudflare的密钥" CF_Key read -p "请输入cloudflare的密钥" CF_Key
if [[ $CF_Key =~ "\w+" ]];then if [[ ! $CF_Key =~ "\w+" ]];then
echo "密钥不合法" echo "密钥不合法"
exit exit
fi fi