安装 linux 依赖自动识别 alpine 和 debian

This commit is contained in:
whyour
2024-06-30 00:47:41 +08:00
parent d6be908a2c
commit 29896b8c94
6 changed files with 237 additions and 40 deletions
+9 -1
View File
@@ -9,7 +9,15 @@ else
fi
echo -e "\n1、安装bot依赖...\n"
apt install -y gcc python3-dev musl-dev
os_name=$(source /etc/os-release && echo "$ID")
if [[ $os_name == 'alpine' ]]; then
apk --no-cache add -f zlib-dev gcc jpeg-dev python3-dev musl-dev freetype-dev
elif [[ $os_name == 'debian' ]] || [[ $os_name == 'ubuntu' ]]; then
apt install -y gcc python3-dev musl-dev
else
echo -e "暂不支持此系统 $os_name"
exit 1
fi
echo -e "\nbot依赖安装成功...\n"
echo -e "2、下载bot所需文件...\n"
-3
View File
@@ -48,9 +48,6 @@ if [[ $os_name == 'alpine' ]]; then
elif [[ $os_name == 'debian' ]] || [[ $os_name == 'ubuntu' ]]; then
apt update
apt install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client
elif [[ $os_name == 'centos' ]]; then
yum update
yum install -y epel-release git curl wget tzdata perl openssl jq nginx procps nc openssh-client
else
echo -e "暂不支持此系统部署 $os_name"
exit 1