From e3b414925d4c8b21520b6e586b080a691b4bb359 Mon Sep 17 00:00:00 2001 From: medmunds Date: Sun, 14 Feb 2021 19:59:48 -0800 Subject: [PATCH] Switch from cp to cat to preserve file permissions --- deploy/unifi.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/unifi.sh b/deploy/unifi.sh index a3c6f6f1..a864135e 100644 --- a/deploy/unifi.sh +++ b/deploy/unifi.sh @@ -141,8 +141,8 @@ unifi_deploy() { return 1 fi - cp "$_cfullchain" "${_cloudkey_certdir}/cloudkey.crt" - cp "$_ckey" "${_cloudkey_certdir}/cloudkey.key" + cat "$_cfullchain" >"${_cloudkey_certdir}/cloudkey.crt" + cat "$_ckey" >"${_cloudkey_certdir}/cloudkey.key" (cd "$_cloudkey_certdir" && tar -cf cert.tar cloudkey.crt cloudkey.key unifi.keystore.jks) if systemctl -q is-active nginx; then @@ -165,8 +165,8 @@ unifi_deploy() { return 1 fi - cp "$_cfullchain" "${_unifi_core_config}/unifi-core.crt" - cp "$_ckey" "${_unifi_core_config}/unifi-core.key" + cat "$_cfullchain" >"${_unifi_core_config}/unifi-core.crt" + cat "$_ckey" >"${_unifi_core_config}/unifi-core.key" if systemctl -q is-active unifi-core; then _reload_cmd="${_reload_cmd:+$_reload_cmd && }systemctl restart unifi-core"