Revert changes

pull/304/head
hiCasper 2 years ago
parent e68c7b0346
commit ca27a2d49d
  1. 41
      scripts/install.sh
  2. 46
      scripts/install_dev.sh
  3. 51
      scripts/update.sh
  4. 52
      scripts/update_dev.sh

@ -20,42 +20,37 @@ if [ "$EUID" -ne 0 ]
exit exit
fi fi
# macOS
if [ ${_os} == "Darwin" ]; then if [ ${_os} == "Darwin" ]; then
OSNAME='macos' OSNAME='macos'
# SUSE Linux
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
zypper install cron wget curl zip unzip zypper install cron wget curl zip unzip
# FreeBSD
elif grep -Eq "FreeBSD" /etc/*-release; then elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd' OSNAME='freebsd'
# Arch Linux elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/redhat-release; then
elif [ -f /etc/arch-release ]; then OSNAME='rhel'
OSNAME='arch' yum install -y wget curl zip unzip tar crontabs
pacman -Syu --noconfirm elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
pacman -S --noconfirm curl cronie OSNAME='fedora'
# Enterprise Linux yum install -y wget curl zip unzip tar crontabs
elif [ -f /etc/redhat-release ]; then elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/redhat-release; then
if grep -Eq "AlmaLinux" /etc/redhat-release ; then OSNAME='alma'; OSNAME='rhel'
elif grep -Eq "CentOS" /etc/redhat-release ; then OSNAME='centos'; yum install -y wget curl zip unzip tar crontabs
elif grep -Eq "Rocky" /etc/redhat-release ; then OSNAME='rocky'; elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/redhat-release; then
elif grep -Eq "Red Hat" /etc/redhat-release ; then OSNAME='rhel';
fi
OSNAME='rhel' OSNAME='rhel'
if grep -Eq "Amazon Linux" /etc/redhat-release ; then OSNAME='amazon'; fi
if grep -Eq "Fedora" /etc/redhat-release ; then OSNAME='fedora'; fi
yum install -y wget curl zip unzip tar crontabs yum install -y wget curl zip unzip tar crontabs
# Debian / Ubuntu elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
elif [ -f /etc/lsb-release ]; then OSNAME='amazon'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/os-release; then
OSNAME='debian' OSNAME='debian'
if grep -Eq "Ubuntu" /etc/os-release; then OSNAME='ubuntu';
elif grep -Eq "Debian" /etc/os-release; then OSNAME='debian';
fi
apt update -y apt update -y
apt install -y wget curl zip unzip tar cron apt install -y wget curl zip unzip tar cron
# Others elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/os-release; then
OSNAME='ubuntu'
apt update -y
apt install -y wget curl zip unzip tar cron
else else
OSNAME='unknow' OSNAME='unknow'
fi fi

@ -25,42 +25,36 @@ if [ "$EUID" -ne 0 ]
fi fi
# macOS
if [ ${_os} == "Darwin" ]; then if [ ${_os} == "Darwin" ]; then
OSNAME='macos' OSNAME='macos'
# SUSE Linux
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
zypper install cron wget curl zip unzip
# FreeBSD
elif grep -Eq "FreeBSD" /etc/*-release; then elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd' OSNAME='freebsd'
# Arch Linux elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
elif [ -f /etc/arch-release ]; then OSNAME='rhel'
OSNAME='arch' yum install -y wget zip unzip
pacman -Syu --noconfirm elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
pacman -S --noconfirm curl cronie OSNAME='fedora'
# Enterprise Linux yum install -y wget zip unzip
elif [ -f /etc/redhat-release ]; then elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
if grep -Eq "AlmaLinux" /etc/redhat-release ; then OSNAME='alma';
elif grep -Eq "CentOS" /etc/redhat-release ; then OSNAME='centos';
elif grep -Eq "Rocky" /etc/redhat-release ; then OSNAME='rocky';
elif grep -Eq "Red Hat" /etc/redhat-release ; then OSNAME='rhel';
fi
OSNAME='rhel' OSNAME='rhel'
if grep -Eq "Amazon Linux" /etc/redhat-release ; then OSNAME='amazon'; fi yum install -y wget zip unzip
if grep -Eq "Fedora" /etc/redhat-release ; then OSNAME='fedora'; fi elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
yum install -y wget curl zip unzip tar crontabs OSNAME='rhel'
# Debian / Ubuntu yum install -y wget zip unzip
elif [ -f /etc/lsb-release ]; then elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
OSNAME='amazon'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
OSNAME='debian' OSNAME='debian'
if grep -Eq "Ubuntu" /etc/os-release; then OSNAME='ubuntu';
elif grep -Eq "Debian" /etc/os-release; then OSNAME='debian';
fi
apt update -y apt update -y
apt install -y wget curl zip unzip tar cron apt install -y devscripts
# Others apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
else else
OSNAME='unknow' OSNAME='unknow'
fi fi

@ -19,42 +19,37 @@ if [ ${_os} != "Darwin" ] && [ ! -d /www/server/mdserver-web/logs ]; then
fi fi
{ {
# macOS
if [ ${_os} == "Darwin" ]; then if [ ${_os} == "Darwin" ]; then
OSNAME='macos' OSNAME='macos'
# SUSE Linux
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
zypper install cron wget curl zip unzip
# FreeBSD
elif grep -Eq "FreeBSD" /etc/*-release; then elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd' OSNAME='freebsd'
# Arch Linux elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
elif [ -f /etc/arch-release ]; then OSNAME='centos'
OSNAME='arch' yum install -y wget zip unzip
pacman -Syu --noconfirm elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
pacman -S --noconfirm curl cronie OSNAME='fedora'
# Enterprise Linux yum install -y wget zip unzip
elif [ -f /etc/redhat-release ]; then elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
if grep -Eq "AlmaLinux" /etc/redhat-release ; then OSNAME='alma'; OSNAME='rocky'
elif grep -Eq "CentOS" /etc/redhat-release ; then OSNAME='centos'; yum install -y wget zip unzip
elif grep -Eq "Rocky" /etc/redhat-release ; then OSNAME='rocky'; elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
elif grep -Eq "Red Hat" /etc/redhat-release ; then OSNAME='rhel'; OSNAME='alma'
fi yum install -y wget zip unzip
OSNAME='rhel' elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
if grep -Eq "Amazon Linux" /etc/redhat-release ; then OSNAME='amazon'; fi OSNAME='amazon'
if grep -Eq "Fedora" /etc/redhat-release ; then OSNAME='fedora'; fi yum install -y wget zip unzip
yum install -y wget curl zip unzip tar crontabs elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
# Debian / Ubuntu
elif [ -f /etc/lsb-release ]; then
OSNAME='debian' OSNAME='debian'
if grep -Eq "Ubuntu" /etc/os-release; then OSNAME='ubuntu'; apt install -y wget zip unzip
elif grep -Eq "Debian" /etc/os-release; then OSNAME='debian'; elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
fi OSNAME='ubuntu'
apt update -y apt install -y wget zip unzip
apt install -y wget curl zip unzip tar cron elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
# Others OSNAME='raspbian'
else else
OSNAME='unknow' OSNAME='unknow'
fi fi

@ -19,47 +19,41 @@ if [ ${_os} != "Darwin" ] && [ ! -d /www/server/mdserver-web/logs ]; then
fi fi
{ {
# macOS
if [ ${_os} == "Darwin" ]; then if [ ${_os} == "Darwin" ]; then
OSNAME='macos' OSNAME='macos'
# SUSE Linux
elif grep -Eq "openSUSE" /etc/*-release; then elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse' OSNAME='opensuse'
zypper refresh zypper refresh
zypper install cron wget curl zip unzip
# FreeBSD
elif grep -Eq "FreeBSD" /etc/*-release; then elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd' OSNAME='freebsd'
# Arch Linux elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
elif [ -f /etc/arch-release ]; then OSNAME='centos'
OSNAME='arch' yum install -y wget zip unzip
pacman -Syu --noconfirm elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
pacman -S --noconfirm curl cronie OSNAME='fedora'
# Enterprise Linux yum install -y wget zip unzip
elif [ -f /etc/redhat-release ]; then elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
if grep -Eq "AlmaLinux" /etc/redhat-release ; then OSNAME='alma'; OSNAME='rocky'
elif grep -Eq "CentOS" /etc/redhat-release ; then OSNAME='centos'; yum install -y wget zip unzip
elif grep -Eq "Rocky" /etc/redhat-release ; then OSNAME='rocky'; elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
elif grep -Eq "Red Hat" /etc/redhat-release ; then OSNAME='rhel'; OSNAME='alma'
fi yum install -y wget zip unzip
OSNAME='rhel' elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
if grep -Eq "Amazon Linux" /etc/redhat-release ; then OSNAME='amazon'; fi OSNAME='amazon'
if grep -Eq "Fedora" /etc/redhat-release ; then OSNAME='fedora'; fi yum install -y wget zip unzip
yum install -y wget curl zip unzip tar crontabs elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
# Debian / Ubuntu
elif [ -f /etc/lsb-release ]; then
OSNAME='debian' OSNAME='debian'
if grep -Eq "Ubuntu" /etc/os-release; then OSNAME='ubuntu'; apt install -y wget zip unzip
elif grep -Eq "Debian" /etc/os-release; then OSNAME='debian'; elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
fi OSNAME='ubuntu'
apt update -y apt install -y wget zip unzip
apt install -y wget curl zip unzip tar cron elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
# Others OSNAME='raspbian'
else else
OSNAME='unknow' OSNAME='unknow'
fi fi
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 [ ! -z "$cn" ];then if [ ! -z "$cn" ];then
curl -sSLo /tmp/dev.zip https://gitee.com/midoks/mdserver-web/repository/archive/dev.zip curl -sSLo /tmp/dev.zip https://gitee.com/midoks/mdserver-web/repository/archive/dev.zip

Loading…
Cancel
Save