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
|
2024-11-18 23:12:52 +08:00
|
|
|
|
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
|
2024-11-18 23:12:52 +08:00
|
|
|
|
declare email_address
|
|
|
|
|
read -p "请输入用来申请域名的邮箱:" email_address
|
|
|
|
|
if [[ ! $email_address =~ .*@.* ]];then
|
2024-09-27 14:22:23 +08:00
|
|
|
|
echo "邮箱不合法"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2024-11-18 23:12:52 +08:00
|
|
|
|
curl https://get.acme.sh | sh -s "email=$email_address"
|
2024-09-27 14:22:23 +08:00
|
|
|
|
fi
|