This commit is contained in:
BoHung Chiu 2022-09-25 16:17:18 +08:00
parent f48fd51b21
commit 1e8bc0c650
2 changed files with 8 additions and 2 deletions

View File

@ -116,7 +116,7 @@ else
mongorestore -d $new_db_name $(basename $mongo_output)/$db_name --drop mongorestore -d $new_db_name $(basename $mongo_output)/$db_name --drop
sed "s/\(database:\s\+\).\+/\1${new_db_name}/g" -i "$local_store_path/config/mongoid.yml" sed "s/\(database:\s\+\).\+/\1${new_db_name}/g" -i "$local_store_path/config/mongoid.yml"
if [[ -z "$use_local_command" ]] && [[ ! -z "$match_ssl" ]]; then if [[ -z "$use_local_command" ]] && [[ ! -z "$match_ssl" ]]; then
if [[ ! -z $org_ssl_dir ]]; then if [[ ! -z "$org_ssl_dir" ]]; then
if [ -z "$(which certbot)" ]; then if [ -z "$(which certbot)" ]; then
wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/install_certbot.sh wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/install_certbot.sh
sudo_command bash ./install_certbot.sh sudo_command bash ./install_certbot.sh
@ -146,6 +146,9 @@ else
fi fi
fi fi
fi fi
sudo_command chmod 700 /etc/letsencrypt/archive -R
sudo_command chmod 700 /etc/letsencrypt/live -R
rm -rf ssl_files
else else
sed "s/$(escape_slash $ssl_certificate_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_file)/g" -i $new_nginx_file sed "s/$(escape_slash $ssl_certificate_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_file)/g" -i $new_nginx_file
sed "s/$(escape_slash $ssl_certificate_key_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_key_file)/g" -i $new_nginx_file sed "s/$(escape_slash $ssl_certificate_key_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_key_file)/g" -i $new_nginx_file

View File

@ -120,7 +120,7 @@ else
mongorestore -d $new_db_name $(basename $mongo_output)/$db_name --drop mongorestore -d $new_db_name $(basename $mongo_output)/$db_name --drop
sed "s/\(database:\s\+\).\+/\1${new_db_name}/g" -i "$local_store_path/config/mongoid.yml" sed "s/\(database:\s\+\).\+/\1${new_db_name}/g" -i "$local_store_path/config/mongoid.yml"
if [[ -z "$use_local_command" ]] && [[ ! -z "$match_ssl" ]]; then if [[ -z "$use_local_command" ]] && [[ ! -z "$match_ssl" ]]; then
if [[ ! -z $org_ssl_dir ]]; then if [[ ! -z "$org_ssl_dir" ]]; then
if [ -z "$(which certbot)" ]; then if [ -z "$(which certbot)" ]; then
wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/install_certbot.sh wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/install_certbot.sh
sudo_command bash ./install_certbot.sh sudo_command bash ./install_certbot.sh
@ -150,6 +150,9 @@ else
fi fi
fi fi
fi fi
sudo_command chmod 700 /etc/letsencrypt/archive -R
sudo_command chmod 700 /etc/letsencrypt/live -R
rm -rf ssl_files
else else
sed "s/$(escape_slash $ssl_certificate_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_file)/g" -i $new_nginx_file sed "s/$(escape_slash $ssl_certificate_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_file)/g" -i $new_nginx_file
sed "s/$(escape_slash $ssl_certificate_key_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_key_file)/g" -i $new_nginx_file sed "s/$(escape_slash $ssl_certificate_key_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_key_file)/g" -i $new_nginx_file