This commit is contained in:
邱博亞 2024-06-14 21:16:28 +08:00
parent 0801fae03d
commit eb84cbaaea
1 changed files with 11 additions and 5 deletions

View File

@ -47,7 +47,7 @@ function write_messages(){
}
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
sudo sed -i -E 's/logAppend.*/logRotate: reopen\n \0/g' /etc/mongod.conf
fi
sudo bash -l -c "
cd /root && \
@ -284,10 +284,10 @@ if [[ "$ubuntu_version" > '21' ]]; then # ruby must use openssl <= 1.1.1. Not su
sudo ln -s /etc/ssl/certs/ /opt/openssl/ssl/.
sudo mkdir -p /etc/apt/trusted.gpg.d/
fi
cd /etc/nginx/
sudo mkdir orbit_sites/
if [ -z "$(grep 'orbit_sites' nginx.conf)" ]; then
sudo sed -i 's/\(include\ \/etc\/nginx\/sites-enabled\/\*\;\)/\1\n include\ \/etc\/nginx\/orbit_sites\/*;/g' nginx.conf
sudo mkdir -p /etc/nginx/orbit_sites
nginx_conf="/etc/nginx/nginx.conf"
if [ -z "$(grep 'orbit_sites' $nginx_conf)" ]; then
sudo sed -i 's/\(include\ \/etc\/nginx\/sites-enabled\/\*\;\)/\1\n include\ \/etc\/nginx\/orbit_sites\/*;/g' $nginx_conf
fi
if [[ "$ubuntu_version" > '22' ]]; then #Use root account prevent reading socket denied
sudo sed -E -i 's/^[# ]*user.*/user root;/g' /etc/nginx/nginx.conf
@ -353,6 +353,12 @@ if [ -z $(which rvm) ]; then
rvm user gemsets
sudo chown $USER:$USER /usr/share/rvm -R
fi
if [ -z "$(grep rvm_max_time_flag ~/.rvmrc)" ]; then
echo "rvm_max_time_flag=200" >> ~/.rvmrc # timeout = 200 minutes
fi
source ~/.rvmrc
source "/etc/profile.d/rvm.sh"
# install ruby 2.7.6
if [[ -z "$openssl_dir" ]]; then