Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/scripts/install.sh

52 lines
1.6 KiB

7 years ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
LANG=en_US.UTF-8
is64bit=`getconf LONG_BIT`
7 years ago
5 years ago
if [ -f /etc/motd ];then
3 years ago
echo "welcome to mdserver-web panel" > /etc/motd
5 years ago
fi
7 years ago
startTime=`date +%s`
6 years ago
_os=`uname`
3 years ago
echo "use system: ${_os}"
3 years ago
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
sudo ln -sf /bin/bash /bin/sh
#sudo dpkg-reconfigure dash
fi
if [ ${_os} == "Darwin" ]; then
3 years ago
OSNAME='macos'
6 years ago
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
3 years ago
OSNAME='centos'
6 years ago
elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
3 years ago
OSNAME='rhel'
6 years ago
elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then
3 years ago
OSNAME='aliyun'
6 years ago
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
3 years ago
OSNAME='fedora'
6 years ago
elif grep -Eqi "Amazon Linux AMI" /etc/issue || grep -Eq "Amazon Linux AMI" /etc/*-release; then
3 years ago
OSNAME='amazon'
6 years ago
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
3 years ago
OSNAME='debian'
6 years ago
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
3 years ago
OSNAME='ubuntu'
6 years ago
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
3 years ago
OSNAME='raspbian'
6 years ago
elif grep -Eqi "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
3 years ago
OSNAME='deepin'
6 years ago
else
OSNAME='unknow'
fi
3 years ago
echo "use system version: ${OSNAME}"
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | sh
7 years ago
7 years ago
endTime=`date +%s`
((outTime=(${endTime}-${startTime})/60))
6 years ago
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"