From 1e8bc0c650d21127ada6528fc0371653bb19693f Mon Sep 17 00:00:00 2001 From: bohung Date: Sun, 25 Sep 2022 16:17:18 +0800 Subject: [PATCH] Fix bug. --- move_site.sh | 5 ++++- move_site_interactive.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/move_site.sh b/move_site.sh index a727d7d..c247d22 100644 --- a/move_site.sh +++ b/move_site.sh @@ -116,7 +116,7 @@ else 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" 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 wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/install_certbot.sh sudo_command bash ./install_certbot.sh @@ -146,6 +146,9 @@ else fi fi fi + sudo_command chmod 700 /etc/letsencrypt/archive -R + sudo_command chmod 700 /etc/letsencrypt/live -R + rm -rf ssl_files 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_key_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_key_file)/g" -i $new_nginx_file diff --git a/move_site_interactive.sh b/move_site_interactive.sh index 54fff5b..092fc2d 100644 --- a/move_site_interactive.sh +++ b/move_site_interactive.sh @@ -120,7 +120,7 @@ else 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" 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 wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/install_certbot.sh sudo_command bash ./install_certbot.sh @@ -150,6 +150,9 @@ else fi fi fi + sudo_command chmod 700 /etc/letsencrypt/archive -R + sudo_command chmod 700 /etc/letsencrypt/live -R + rm -rf ssl_files 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_key_file)/$(escape_slash $root_path)\/ssl_files\/$(basename $ssl_certificate_key_file)/g" -i $new_nginx_file