Optimize acme.sh install
This commit is contained in:
parent
224b91fe0b
commit
d7337239f5
|
|
@ -29,27 +29,27 @@ elif grep -Eq "FreeBSD" /etc/*-release; then
|
|||
OSNAME='freebsd'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
yum install -y wget curl zip unzip tar
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
yum install -y wget zip unzip
|
||||
yum install -y wget curl zip unzip tar
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
yum install -y wget curl zip unzip tar
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
yum install -y wget curl zip unzip tar
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
yum install -y wget curl zip unzip tar
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
apt install -y devscripts
|
||||
apt install -y wget zip unzip
|
||||
apt install -y wget curl zip unzip tar
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt install -y wget zip unzip
|
||||
apt install -y wget curl zip unzip tar
|
||||
else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
|
@ -69,12 +69,11 @@ if [ $OSNAME != "macos" ];then
|
|||
mkdir -p /www/backup/database
|
||||
mkdir -p /www/backup/site
|
||||
|
||||
|
||||
# https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh
|
||||
|
||||
if [ ! -d /www/server/mdserver-web ];then
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -d /www/server/mdserver-web ];then
|
||||
if [ ! -z "$cn" ];then
|
||||
curl -sSLo /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip
|
||||
else
|
||||
|
|
@ -86,12 +85,28 @@ if [ $OSNAME != "macos" ];then
|
|||
rm -rf /tmp/master.zip
|
||||
rm -rf /tmp/mdserver-web-master
|
||||
fi
|
||||
|
||||
# install acme.sh
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
if [ ! -z "$cn" ];then
|
||||
curl -sSL -o /tmp/acme.tar.gz https://ghproxy.com/github.com/acmesh-official/acme.sh/archive/master.tar.gz
|
||||
tar xvzf /tmp/acme.tar.gz -C /tmp
|
||||
cd /tmp/acme.sh-master
|
||||
bash acme.sh install
|
||||
cd -
|
||||
fi
|
||||
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo "use system version: ${OSNAME}"
|
||||
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
|
||||
|
||||
|
||||
cd /www/server/mdserver-web && bash cli.sh start
|
||||
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
|
||||
n=0
|
||||
|
|
|
|||
|
|
@ -14,11 +14,6 @@ dnf install -y python-devel
|
|||
dnf install -y crontabs
|
||||
dnf install -y mysql-devel
|
||||
|
||||
#https need
|
||||
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
|
|
|
|||
|
|
@ -21,13 +21,6 @@ yum install -y curl-devel libmcrypt libmcrypt-devel
|
|||
yum install -y mysql-devel
|
||||
yum install -y expect
|
||||
|
||||
|
||||
|
||||
#https need
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
|
|
|
|||
|
|
@ -54,11 +54,6 @@ echo y | pacman -Syu icu
|
|||
|
||||
hwclock --systohc
|
||||
|
||||
#https need
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
|
|
|
|||
|
|
@ -23,12 +23,6 @@ yum install -y mysql-devel
|
|||
yum install -y expect
|
||||
|
||||
|
||||
|
||||
#https need
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
|
|
|
|||
|
|
@ -12,6 +12,12 @@ elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
|||
fi
|
||||
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
NTPHOST='time.nist.gov'
|
||||
if [ ! -z "$cn" ];then
|
||||
NTPHOST='ntp1.aliyun.com'
|
||||
fi
|
||||
|
||||
ln -sf /bin/bash /bin/sh
|
||||
|
||||
__GET_BIT=`getconf LONG_BIT`
|
||||
|
|
@ -23,18 +29,14 @@ fi
|
|||
|
||||
# synchronize time first
|
||||
apt-get install ntpdate -y
|
||||
ntpdate time.nist.gov | logger -t NTP
|
||||
ntpdate $NTPHOST | logger -t NTP
|
||||
|
||||
apt-get update -y
|
||||
apt install -y wget curl lsof unzip cron expect locate
|
||||
apt install -y wget curl lsof unzip tar cron expect locate
|
||||
apt install -y python3-pip python3-dev python3-venv
|
||||
locale-gen en_US.UTF-8
|
||||
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
|
||||
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/ufw ];then
|
||||
|
||||
ufw allow 22/tcp
|
||||
|
|
|
|||
|
|
@ -17,12 +17,6 @@ yum install -y wget curl lsof unzip
|
|||
yum install -y expect
|
||||
dnf install crontabs -y
|
||||
|
||||
#https need
|
||||
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
|
|
|
|||
|
|
@ -37,14 +37,8 @@ pkg install -y harfbuzz
|
|||
|
||||
# pkg install -y py38-cffi
|
||||
|
||||
|
||||
pkg autoremove -y
|
||||
|
||||
#https need
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
|
|
|
|||
|
|
@ -51,10 +51,6 @@ zypper install -y libXpm-devel
|
|||
zypper install -y freetype2-devel
|
||||
|
||||
# zypper install -y php-config
|
||||
#https need
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
|
|
|
|||
|
|
@ -18,11 +18,6 @@ yum install -y python3-devel
|
|||
yum install -y crontabs
|
||||
yum install -y expect
|
||||
yum install -y curl curl-devel libcurl libcurl-devel
|
||||
#https need
|
||||
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/iptables ];then
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@ apt install -y expect
|
|||
|
||||
apt install -y cron
|
||||
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
apt install -y locate
|
||||
locale-gen en_US.UTF-8
|
||||
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
|
||||
|
|
|
|||
Loading…
Reference in New Issue