linuxtool/Config/Web/acme/test.sh

29 lines
736 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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未安装请手动安装"
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
echo "邮箱不合法"
exit
fi
curl https://get.acme.sh | sh -s "email=$email_address"
fi