Update install env script.

This commit is contained in:
BoHung Chiu 2022-12-28 09:21:34 +08:00
parent 28ef2b4565
commit ae3b405f1c
1 changed files with 17 additions and 0 deletions

View File

@ -46,6 +46,21 @@ function write_messages(){
echo "$messages_logs" > install_orbit_environment.log
echo "Logs stored in install_orbit_environment.log!"
}
function fix_mongod_and_logrotate(){
if [ -z "$(grep logRotate /etc/mongod.conf)" ]; then
sed -i -E 's/logAppend.*/logRotate: reopen\n \0/g' /etc/mongod.conf
fi
sudo bash -l -c "
cd /root && \
git clone https://github.com/logrotate/logrotate && \
cd logrotate && \
apt-get -y install autoconf automake libpopt-dev libtool make xz-utils && \
autoreconf -fiv && \
./configure --prefix=/usr && \
make && make install && \
logrotate -d /etc/logrotate.conf"
cd "$org_pwd"
}
if [[ $ubuntu_version > '21' ]]; then
function apt_add_key_func(){
url="$1"
@ -126,6 +141,7 @@ if [[ $ubuntu_version =~ '14' ]]; then
push_messages "mongo not yet start!"
push_messages "Please check mongo status!"
fi
fix_mongod_and_logrotate
fi
else
# install mongod 6.0
@ -228,6 +244,7 @@ else
push_messages "mongo not yet start!"
push_messages "Please check mongo status!"
fi
fix_mongod_and_logrotate
fi
fi
# build ImageMagick and install