Skip to content

Commit 54671e5

Browse files
NuctoriCandyMi
authored andcommitted
Update build.sh
依赖自动安装,增加更多系统的支持
1 parent 6ecbf81 commit 54671e5

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

build.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,26 @@ fi
3232
read isAutoDependence
3333
if [[ $isAutoDependence == "y" ]] || [[ $isAutoDependence == "yes" ]]
3434
then
35-
if [[ $osID == "debian" ]] || [[ $osID == "ubuntu" ]]
35+
if [[ $osID == "debian" ]] || [[ $osID == "ubuntu" || $osID == "kali" ]] || $osID == "linuxmint" ]] || $osID == "pop" ]] || $osID == "mx" ]] || $osID == "deepin" ]]
3636
then
37-
sudo apt install gcc file autoconf automake make libtool git libssl-dev --no-upgrade
38-
elif [[ $osID == "centos" ]]
37+
if [ `id -u` -ne 0 ]; then
38+
sudo apt install gcc file autoconf automake make libtool git libssl-dev zlib1g-dev --no-upgrade
39+
else
40+
apt install gcc file autoconf automake make libtool git libssl-dev zlib1g-dev --no-upgrade
41+
fi
42+
elif [[ $osID == "centos" || $osID == "rhel" ]] || [[ $osID == "suse" ]] || [[ $osID == "rocky" ]] || [[ $osID == "ol" ]] || [[ $osID == "scientific" ]] || [[ $osID == "almalinux" ]]
3943
then
40-
sudo yum install gcc file autoconf automake make libtool git openssl-devel -y
44+
if [ `id -u` -ne 0 ]; then
45+
sudo yum install gcc file autoconf automake make libtool git zlib-devel openssl-devel -y
46+
else
47+
yum install gcc file autoconf automake make libtool git zlib-devel openssl-devel -y
48+
fi
49+
elif [[ $osID == "arch" || $osID == "artix" ]] || [[ $osID == "manjaro" ]] || [[ $osID == "endeavouros" ]] || [[ $osID == "parabola" ]] || [[ $osID == "archbang" ]]
50+
if [ `id -u` -ne 0 ]; then
51+
sudo pacman -S gcc file autoconf automake make libtool git zlib-devel openssl-devel
52+
else
53+
pacman -S gcc file autoconf automake make libtool git zlib-devel openssl-devel
54+
fi
4155
else
4256
echo $osID "not support anto install dependence, please request issue. https://github.com/cfadmin-cn/cfadmin"
4357
fi

0 commit comments

Comments
 (0)