This commit is contained in:
BoHung Chiu 2023-04-20 14:32:52 +08:00
parent 07721eaa30
commit 0776ba723d
2 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ else
if [[ "$(dirname $org_ssl_dir)" == "/etc/letsencrypt/live" ]] && [[ ! -z "$(sudo_command find $org_ssl_dir -name '*.pem' 2>>/dev/null || echo '')" ]]; then if [[ "$(dirname $org_ssl_dir)" == "/etc/letsencrypt/live" ]] && [[ ! -z "$(sudo_command find $org_ssl_dir -name '*.pem' 2>>/dev/null || echo '')" ]]; then
sudo_command mkdir -p /etc/letsencrypt/archive/$real_domain sudo_command mkdir -p /etc/letsencrypt/archive/$real_domain
sudo_command rm -f /etc/letsencrypt/archive/$real_domain/*.pem sudo_command rm -f /etc/letsencrypt/archive/$real_domain/*.pem
sudo_command mv $org_ssl_dir/*.pem /etc/letsencrypt/archive/$real_domain/. sudo_command find $org_ssl_dir -name '*.pem' -exec mv {} /etc/letsencrypt/archive/$real_domain/. \;
if [[ ! -z "$certbot_file_idx" ]]; then if [[ ! -z "$certbot_file_idx" ]]; then
sudo_command bash -l -c "find '/etc/letsencrypt/archive/$real_domain' -regex '[^0-9]+\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/($(echo /etc/letsencrypt/archive/$real_domain/|sed 's/[\.\/]/\\\0/g')[^\d]+)\.pem/\${1}'$certbot_file_idx'\.pem/'| xargs -0 -n 2 mv" sudo_command bash -l -c "find '/etc/letsencrypt/archive/$real_domain' -regex '[^0-9]+\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/($(echo /etc/letsencrypt/archive/$real_domain/|sed 's/[\.\/]/\\\0/g')[^\d]+)\.pem/\${1}'$certbot_file_idx'\.pem/'| xargs -0 -n 2 mv"
sudo_command bash -l -c "cd $org_ssl_dir && find '../../archive/$real_domain/' -regex '[^0-9]+$certbot_file_idx\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/$(echo ../../archive/$real_domain/|sed 's/[\.\/]/\\\0/g')([^\d]+)$certbot_file_idx\.pem/\${1}\.pem/'| xargs -0 -n 2 ln -s" sudo_command bash -l -c "cd $org_ssl_dir && find '../../archive/$real_domain/' -regex '[^0-9]+$certbot_file_idx\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/$(echo ../../archive/$real_domain/|sed 's/[\.\/]/\\\0/g')([^\d]+)$certbot_file_idx\.pem/\${1}\.pem/'| xargs -0 -n 2 ln -s"

View File

@ -135,7 +135,7 @@ else
if [[ "$(dirname $org_ssl_dir)" == "/etc/letsencrypt/live" ]] && [[ ! -z "$(sudo_command find $org_ssl_dir -name '*.pem' 2>>/dev/null || echo '')" ]]; then if [[ "$(dirname $org_ssl_dir)" == "/etc/letsencrypt/live" ]] && [[ ! -z "$(sudo_command find $org_ssl_dir -name '*.pem' 2>>/dev/null || echo '')" ]]; then
sudo_command mkdir -p /etc/letsencrypt/archive/$real_domain sudo_command mkdir -p /etc/letsencrypt/archive/$real_domain
sudo_command rm -f /etc/letsencrypt/archive/$real_domain/*.pem sudo_command rm -f /etc/letsencrypt/archive/$real_domain/*.pem
sudo_command mv $org_ssl_dir/*.pem /etc/letsencrypt/archive/$real_domain/. sudo_command find $org_ssl_dir -name '*.pem' -exec mv {} /etc/letsencrypt/archive/$real_domain/. \;
if [[ ! -z "$certbot_file_idx" ]]; then if [[ ! -z "$certbot_file_idx" ]]; then
sudo_command bash -l -c "find '/etc/letsencrypt/archive/$real_domain' -regex '[^0-9]+\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/($(echo /etc/letsencrypt/archive/$real_domain/|sed 's/[\.\/]/\\\0/g')[^\d]+)\.pem/\${1}'$certbot_file_idx'\.pem/'| xargs -0 -n 2 mv" sudo_command bash -l -c "find '/etc/letsencrypt/archive/$real_domain' -regex '[^0-9]+\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/($(echo /etc/letsencrypt/archive/$real_domain/|sed 's/[\.\/]/\\\0/g')[^\d]+)\.pem/\${1}'$certbot_file_idx'\.pem/'| xargs -0 -n 2 mv"
sudo_command bash -l -c "cd $org_ssl_dir && find '../../archive/$real_domain/' -regex '[^0-9]+$certbot_file_idx\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/$(echo ../../archive/$real_domain/|sed 's/[\.\/]/\\\0/g')([^\d]+)$certbot_file_idx\.pem/\${1}\.pem/'| xargs -0 -n 2 ln -s" sudo_command bash -l -c "cd $org_ssl_dir && find '../../archive/$real_domain/' -regex '[^0-9]+$certbot_file_idx\.pem' -printf '%p\0'| perl -0 -l0 -pe 'print \$_; s/$(echo ../../archive/$real_domain/|sed 's/[\.\/]/\\\0/g')([^\d]+)$certbot_file_idx\.pem/\${1}\.pem/'| xargs -0 -n 2 ln -s"