更改build.sh构建脚本, 支持低版本Debian系统

This commit is contained in:
aixiao 2022-12-02 09:31:34 +08:00
parent 8c3f15ba6d
commit 80c680b8aa

View File

@ -54,7 +54,7 @@ pkg_install()
yum -y install devtoolset-11-gcc yum -y install devtoolset-11-gcc
#source /opt/rh/devtoolset-11/enable #临时 #source /opt/rh/devtoolset-11/enable #临时
if test "`grep "devtoolset" /etc/profile`" != ""; then if test "`grep "devtoolset" /etc/profile`" = ""; then
echo "source /opt/rh/devtoolset-11/enable" >> /etc/profile #永久 echo "source /opt/rh/devtoolset-11/enable" >> /etc/profile #永久
fi fi
source /opt/rh/devtoolset-11/enable source /opt/rh/devtoolset-11/enable
@ -73,6 +73,7 @@ main()
make clean; make make clean; make
if test "$OS" = "centos"; then
if test -f /etc/cron.d/clamav-update; then # 去除自动更新病毒库 if test -f /etc/cron.d/clamav-update; then # 去除自动更新病毒库
mv /etc/cron.d/clamav-update /root mv /etc/cron.d/clamav-update /root
fi fi
@ -81,6 +82,9 @@ main()
sed -i "s/DatabaseMirror .*/DatabaseMirror clamavdb.c3sl.ufpr.br/g" /etc/freshclam.conf sed -i "s/DatabaseMirror .*/DatabaseMirror clamavdb.c3sl.ufpr.br/g" /etc/freshclam.conf
fi fi
fi
if test -f /etc/clamav/freshclam.conf; then if test -f /etc/clamav/freshclam.conf; then
sed -i "s/DatabaseMirror .*/DatabaseMirror clamavdb.c3sl.ufpr.br/g" /etc/clamav/freshclam.conf sed -i "s/DatabaseMirror .*/DatabaseMirror clamavdb.c3sl.ufpr.br/g" /etc/clamav/freshclam.conf
else else
@ -88,6 +92,16 @@ main()
fi fi
if test "$OS" = "debian"; then
condition=$(awk -v num1=${OS_VER} -v num2=11 'BEGIN{print(num1>num2)?"0":"1"}')
if test "$condition" = "1"; then # Debian系统版本小于11时, libclamav库版本低时
cd clamscan/libclamav/; bash build.sh
cp /usr/lib/x86_64-linux-gnu/libclamav.so.9.0.5 /usr/lib/x86_64-linux-gnu/libclamav.so.9.0.5.backup
cp clamscan/libclamav/.libs/libclamav.so.9.0.5 /usr/lib/x86_64-linux-gnu/
fi
fi
tmux new-session -s main -d && tmux send -t main './rhost -d' ENTER tmux new-session -s main -d && tmux send -t main './rhost -d' ENTER
tmux at -t main tmux at -t main