linuxtool/Config/Web/acme/test.sh

29 lines
736 B
Bash
Raw Normal View History

2024-09-27 14:22:23 +08:00
#!/bin/bash
if ! command -v socat &> /dev/null; then
if [[ -f "/usr/bin/apt-get" ]];then
apt-get update -y
apt-get install socat -y
elif [[ -f "/usr/bin/apt" ]];then
apt update -y
apt install socat -y
elif [[ -f "/usr/bin/pacman" ]];then
pacman -Syu --noconfirm
pacman -Sy --noconfirm socat
else
echo "socat未安装请手动安装"
2024-09-27 14:22:23 +08:00
exit
fi
fi
if [[ ! -f "${HOME}/.acme.sh/acme.sh" ]];then
rm -rf ${HOME}/.apple.sh
declare email_address
read -p "请输入用来申请域名的邮箱:" email_address
if [[ ! $email_address =~ .*@.* ]];then
2024-09-27 14:22:23 +08:00
echo "邮箱不合法"
exit
fi
curl https://get.acme.sh | sh -s "email=$email_address"
2024-09-27 14:22:23 +08:00
fi