linuxtool/Config/Web/acme/manage.sh

34 lines
849 B
Bash
Raw Normal View History

2024-09-27 14:22:23 +08:00
#!/bin/bash
echo "1.查看已经成功申请证书的域名"
declare pick
read -p "请输入:" pick
case $pick in
'1')
declare print_name
declare print_number=0
declare -a print_arr
for i in "${HOME}/.acme.sh"/* ; do
print_name=$(basename $i )
2024-09-27 14:29:57 +08:00
if ! echo "$print_name" | grep -q "_ecc" ; then
2024-09-27 14:22:23 +08:00
continue
fi
print_name=$(echo $print_name | sed "s/_ecc//g" )
print_number=$(( print_number+1 ))
print_arr[$print_number]=$print_name
echo "${print_number}.${print_name}"
done
2024-09-27 14:45:16 +08:00
if [ ${#print_arr[@]} == 0 ]; then
echo "暂时没有安装证书"
exit
fi
2024-09-27 14:29:57 +08:00
read -p "请输入要查看证书详细信息的序号:" pick
2024-09-27 14:22:23 +08:00
if [[ $pick =~ [1-${#print_arr[@]}] ]]; then
2024-09-27 14:36:25 +08:00
bash "${HOME}/.acme.sh/acme.sh -info -d ${print_arr[$pick]}"
2024-09-27 14:22:23 +08:00
else
echo "选择错误"
fi
;;
esac