去掉正则加双引号

This commit is contained in:
lsy 2024-09-23 01:37:10 +08:00
parent 91fdf46def
commit 50279b678a
2 changed files with 5 additions and 5 deletions

View File

@ -92,7 +92,7 @@ source "${path}/venv/bin/activate"
for item in "$web_path"/*; do for item in "$web_path"/*; do
declare item_name=\$(basename "\$item") declare item_name=\$(basename "\$item")
if [[ "\$ignore" =~ "\$item_name" ]];then if [[ "\$ignore" =~ \$item_name ]];then
continue continue
fi fi
cd "\$item" || exit cd "\$item" || exit

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
@ -61,7 +61,7 @@ case $pick_mode in
case ${mode_arr[$pick_mode]} in case ${mode_arr[$pick_mode]} in
'TXT记录') 'TXT记录')
declare domain declare domain
declare $log_output=$(acme.sh --issue --dns $domain_str --yes-I-know-dns-manual-mode-enough-go-ahead-please) declare log_output=$(acme.sh --issue --dns $domain_str --yes-I-know-dns-manual-mode-enough-go-ahead-please)
declare domain=$( echo "$log_output" | grep "Domain:" | awk -F ": " '{print $2}') declare domain=$( echo "$log_output" | grep "Domain:" | awk -F ": " '{print $2}')
declare txt_value=$(echo "$log_output" | grep "TXT value:" | awk -F ": " '{print $2}') declare txt_value=$(echo "$log_output" | grep "TXT value:" | awk -F ": " '{print $2}')
echo "请到dns系统解析TXT记录" echo "请到dns系统解析TXT记录"
@ -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