From 464f81166d8135252752947b19b9942360d4754e Mon Sep 17 00:00:00 2001 From: bohung Date: Sun, 25 Sep 2022 15:56:23 +0800 Subject: [PATCH] Fix bug. --- move_site.sh | 2 +- move_site_interactive.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/move_site.sh b/move_site.sh index d2bcfa8..488f595 100644 --- a/move_site.sh +++ b/move_site.sh @@ -93,7 +93,7 @@ else org_ssl_dir=`dirname $ssl_certificate_file` new_ssl_dir="ssl_files/$(basename $org_ssl_dir)" $ssh_command "$remote_sudo_command cp -r -f -L $org_ssl_dir $root_path/ssl_files/." - certbot_file_idx=`$ssh_command "basename $($remote_sudo_command readlink /etc/letsencrypt/live/$real_domain/cert.pem)|sed -E 's/cert([^.]+)\.pem/\1/g'|xargs"` + certbot_file_idx=`$ssh_command "$remote_sudo_command readlink /etc/letsencrypt/live/$real_domain/cert.pem"|xargs basename|sed -E 's/cert([^.]+)\.pem/\1/g'|xargs` else $ssh_command "$remote_sudo_command cp -f $ssl_certificate_file $root_path/ssl_files/." $ssh_command "$remote_sudo_command cp -f $ssl_certificate_key_file $root_path/ssl_files/." diff --git a/move_site_interactive.sh b/move_site_interactive.sh index 3c50efa..8d6c005 100644 --- a/move_site_interactive.sh +++ b/move_site_interactive.sh @@ -97,7 +97,7 @@ else org_ssl_dir=`dirname $ssl_certificate_file` new_ssl_dir="ssl_files/$(basename $org_ssl_dir)" $ssh_command "$remote_sudo_command cp -r -f -L $org_ssl_dir $root_path/ssl_files/." - certbot_file_idx=`$ssh_command "basename $($remote_sudo_command readlink /etc/letsencrypt/live/$real_domain/cert.pem)|sed -E 's/cert([^.]+)\.pem/\1/g'|xargs"` + certbot_file_idx=`$ssh_command "$remote_sudo_command readlink /etc/letsencrypt/live/$real_domain/cert.pem"|xargs basename|sed -E 's/cert([^.]+)\.pem/\1/g'|xargs` else $ssh_command "$remote_sudo_command cp -f $ssl_certificate_file $root_path/ssl_files/." $ssh_command "$remote_sudo_command cp -f $ssl_certificate_key_file $root_path/ssl_files/."