Browse Source
Use 'cat' instead of 'cp', removed use of temp file, keeps permissions
Signed-off-by: invario <67800603+invario@users.noreply.github.com>
pull/6436/head
invario
5 days ago
No known key found for this signature in database
GPG Key ID: DEB3BD5A327B965
1 changed files with
15 additions and
8 deletions
-
deploy/localcopy.sh
|
|
|
@ -67,14 +67,21 @@ localcopy_deploy() { |
|
|
|
fi |
|
|
|
DEPLOY_LOCALCOPY_CERTKEY="" |
|
|
|
_info "Creating combined PEM at $_combined_target" |
|
|
|
_tmpfile="$(mktemp)" |
|
|
|
if ! cat "$_combined_srccert" "$_ckey" >"$_tmpfile"; then |
|
|
|
_err "Failed to build combined PEM file" |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
if ! mv "$_tmpfile" "$_combined_target"; then |
|
|
|
_err "Failed to move combined PEM into place" |
|
|
|
return 1 |
|
|
|
if [ -f "$_combined_target" ]; then |
|
|
|
if ! cat "$_combined_srccert" "$_ckey" >"$_combined_target"; then |
|
|
|
_err "Failed to create PEM file" |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
else |
|
|
|
if ! touch "$_combined_target"; then |
|
|
|
_err "Failed to create PEM file" |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
chmod 600 "$_combined_target" |
|
|
|
if ! cat "$_combined_srccert" "$_ckey" >"$_combined_target"; then |
|
|
|
_err "Failed to create PEM file" |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|