Fix install Imagemagick bug and check mongo feature.

This commit is contained in:
BoHung Chiu 2022-03-10 00:44:14 +08:00
parent a7e15cfcfb
commit 69f1be5633
1 changed files with 8 additions and 4 deletions

View File

@ -41,10 +41,11 @@ sudo rm -f /tmp/mongodb-27017.sock
sudo chown mongodb:mongodb /var/lib/mongodb -R
sudo chown mongodb:mongodb /var/log/mongodb -R
sudo service mongod restart
sleep 10
if [ -f /tmp/mongodb-27017.sock ]; then
echo "Mongo start success!"
else
mongo
mongo --eval "db.version()" --quiet
exit_code="$(echo $?)"
#if mongo 5 core dump, then install mongo 4.4
if [ $exit_code != 0 ] && [ $exit_code != 1 ]; then
@ -82,12 +83,15 @@ if [ -z $(which convert) ]; then
wget -nc http://www.imagemagick.org/download/ImageMagick.tar.gz && \
tar xvfz ImageMagick.tar.gz && \
cd $(ls -d ImageMagick-7*) && \
./configure --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes --disable-shared --with-modules && \
chown $USER:$USER . -R"
tmp_pwd=$(pwd)
cd $(ls -d /root/libpng-1.5.13/ImageMagick-7*)
sudo bash -l -c "./configure --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes --disable-shared --with-modules &&
make && make install && \
ln -s /usr/local/lib/* /usr/lib/. && \
ln -s /usr/local/lib/pkgconfig/* /usr/lib/pkgconfig/. && \
ln -s /usr/local/bin/* /usr/bin/. && \
convert -list configure"
ln -s /usr/local/bin/* /usr/bin/. && \ convert -list configure"
cd $tmp_pwd
fi
## install rvm
if [ -z $(which rvm) ]; then