From ffe6e51edabdf8be7adb65f29b58b34f8517d62e Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 10 Jun 2022 16:12:52 +0800 Subject: [PATCH] Update ubuntu.sh --- scripts/install/ubuntu.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 16654c153..d85be228b 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -10,4 +10,32 @@ mkdir -p /www/wwwlogs mkdir -p /www/backup/database mkdir -p /www/backup/site + +apt install -y wget curl vixie-cron lsof + +if [ ! -f /root/.acme.sh ];then + curl https://get.acme.sh | sh +fi + + +if [ -f /etc/init.d/iptables ];then + + iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT + iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT + iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT + iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT + iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT + iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT + iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT + service iptables save + + iptables_status=`service iptables status | grep 'not running'` + if [ "${iptables_status}" == '' ];then + service iptables restart + fi +fi + +#安装时不开启 +service iptables stop + echo "ubuntu dev ..." \ No newline at end of file