mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
Update kvmd-certbot: fix cp -a to catch dotfiles (#127)
Second pull request for this bug. Apparently, in bash `cp -a <dir>/*` ignores dotfiles, which are often how authfiles get named, notably as per the documentation for SSL cert management for certbot plugins in the PiKVM Wiki. Using `cp -a <dir>/.` instead should catch dotfiles and all files and subdirectories correctly.
This commit is contained in:
parent
99e4615d38
commit
5863004441
@ -108,7 +108,7 @@ case "$1" in
|
||||
renew)
|
||||
shift
|
||||
create_tmp
|
||||
cp -a "$cur"/* "$tmp"
|
||||
cp -a "$cur"/. "$tmp"
|
||||
chown -R "$user:" "$tmp"
|
||||
sed -s -i -e "s| = $cur/| = $tmp/|g" "$tmp/config/renewal/"*
|
||||
sudo --preserve-env -u "$user" certbot renew "$@" \
|
||||
@ -120,7 +120,7 @@ case "$1" in
|
||||
sudo --preserve-env -u "$user" kvmd-pstrun -- bash -c "
|
||||
set -ex
|
||||
rm -rf '$new'
|
||||
cp -a '$tmp' '$new'
|
||||
cp -a '$tmp'/. '$new'
|
||||
rm '$new/updated'
|
||||
chmod 755 '$new/config/'{archive,live}
|
||||
chmod 640 '$new'/config/archive/*/privkey*.pem
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user