add freebsd

pull/119/head
midoks 3 years ago
parent c64d77c48f
commit e25ef09a20
  1. 2
      scripts/install.sh
  2. 80
      scripts/install/freebsd.sh
  3. 2
      scripts/install_cn.sh
  4. 2
      scripts/install_dev.sh
  5. 2
      scripts/update.sh
  6. 77
      scripts/update/freebsd.sh
  7. 2
      scripts/update_cn.sh
  8. 2
      scripts/update_dev.sh

@ -33,6 +33,8 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos' OSNAME='centos'
yum install -y wget zip unzip yum install -y wget zip unzip

@ -0,0 +1,80 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
LANG=en_US.UTF-8
pkg install -y python3
#https need
if [ ! -d /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
#安装时不开启
service iptables stop
fi
if [ ! -f /etc/init.d/iptables ];then
zypper install -y firewalld
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --permanent --zone=public --add-port=22/tcp
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --permanent --zone=public --add-port=443/tcp
firewall-cmd --permanent --zone=public --add-port=888/tcp
firewall-cmd --permanent --zone=public --add-port=7200/tcp
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
firewall-cmd --reload
#安装时不开启
systemctl stop firewalld
fi
cd /www/server/mdserver-web/scripts && bash lib.sh
chmod 755 /www/server/mdserver-web/data
cd /www/server/mdserver-web && ./cli.sh start
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
n=0
while [[ ! -f /etc/init.d/mw ]];
do
echo -e ".\c"
sleep 1
let n+=1
if [ $n -gt 20 ];then
echo -e "start mw fail"
exit 1
fi
done
cd /www/server/mdserver-web && /etc/init.d/mw stop
cd /www/server/mdserver-web && /etc/init.d/mw start
cd /www/server/mdserver-web && /etc/init.d/mw default

@ -33,6 +33,8 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos' OSNAME='centos'
yum install -y wget zip unzip yum install -y wget zip unzip

@ -33,6 +33,8 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
OSNAME='arch' OSNAME='arch'
echo y | pacman -Sy unzip echo y | pacman -Sy unzip

@ -28,6 +28,8 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos' OSNAME='centos'
yum install -y wget zip unzip yum install -y wget zip unzip

@ -0,0 +1,77 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
LANG=en_US.UTF-8
#https need
if [ ! -d /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
#安装时不开启
service iptables stop
fi
if [ ! -f /etc/init.d/iptables ];then
zypper install -y firewalld
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --permanent --zone=public --add-port=22/tcp
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --permanent --zone=public --add-port=443/tcp
firewall-cmd --permanent --zone=public --add-port=888/tcp
firewall-cmd --permanent --zone=public --add-port=7200/tcp
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
firewall-cmd --reload
#安装时不开启
systemctl stop firewalld
fi
cd /www/server/mdserver-web/scripts && bash lib.sh
chmod 755 /www/server/mdserver-web/data
cd /www/server/mdserver-web && ./cli.sh start
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
n=0
while [[ ! -f /etc/init.d/mw ]];
do
echo -e ".\c"
sleep 1
let n+=1
if [ $n -gt 20 ];then
echo -e "start mw fail"
exit 1
fi
done
cd /www/server/mdserver-web && /etc/init.d/mw stop
cd /www/server/mdserver-web && /etc/init.d/mw start
cd /www/server/mdserver-web && /etc/init.d/mw default

@ -28,6 +28,8 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos' OSNAME='centos'
yum install -y wget zip unzip yum install -y wget zip unzip

@ -28,6 +28,8 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
OSNAME='arch' OSNAME='arch'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then

Loading…
Cancel
Save