From aa948dc590af55cc97c00ea22f010f1d36c1d523 Mon Sep 17 00:00:00 2001 From: bohung Date: Sun, 25 Sep 2022 16:54:27 +0800 Subject: [PATCH] Fix bug. --- move_site.sh | 10 ++++++---- move_site_interactive.sh | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/move_site.sh b/move_site.sh index c247d22..4196fc2 100644 --- a/move_site.sh +++ b/move_site.sh @@ -110,6 +110,12 @@ else mkdir -p "$local_store_path" $scp_command$root_path/* $local_store_path/. 2>>/dev/null $scp_command$root_path/.[^.]* $local_store_path/. 2>>/dev/null + 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 + fi + fi cd $local_store_path new_nginx_file="/etc/nginx/orbit_sites/$new_site_name" sudo_command cp -f "$(basename $nginx_file)" $new_nginx_file @@ -117,10 +123,6 @@ else 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 "$(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 - fi sudo_command mkdir -p $org_ssl_dir sudo_command mkdir -p /etc/letsencrypt/renewal sudo_command cp -r $new_ssl_dir/* $org_ssl_dir/. diff --git a/move_site_interactive.sh b/move_site_interactive.sh index 092fc2d..15c17b7 100644 --- a/move_site_interactive.sh +++ b/move_site_interactive.sh @@ -114,6 +114,12 @@ else mkdir -p "$local_store_path" $scp_command$root_path/* $local_store_path/. 2>>/dev/null $scp_command$root_path/.[^.]* $local_store_path/. 2>>/dev/null + 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 + fi + fi cd $local_store_path new_nginx_file="/etc/nginx/orbit_sites/$new_site_name" sudo_command cp -f "$(basename $nginx_file)" $new_nginx_file @@ -121,10 +127,6 @@ else 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 "$(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 - fi sudo_command mkdir -p $org_ssl_dir sudo_command mkdir -p /etc/letsencrypt/renewal sudo_command cp -r $new_ssl_dir/* $org_ssl_dir/.