linuxtool/Config/Web/acme/manage.sh
2024-09-27 14:29:57 +08:00

30 lines
750 B
Bash

#!/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 )
if ! echo "$print_name" | grep -q "_ecc" ; then
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
read -p "请输入要查看证书详细信息的序号:" pick
if [[ $pick =~ [1-${#print_arr[@]}] ]]; then
bash "${HOME}/.acme.sh -info -d ${print_arr[$pick]}"
else
echo "选择错误"
fi
;;
esac