mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-08 15:10:55 +00:00
Use suffixed temp file
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
a44e51bf76
commit
fd8fdd3513
@ -141,6 +141,7 @@ database_table_from_file() {
|
||||
# implementations of mktemp support it, e.g. on Alpine
|
||||
tmpFile="$(mktemp -p "${GRAVITY_TMPDIR}")"
|
||||
mv "${tmpFile}" "${tmpFile%.*}.gravity"
|
||||
tmpFile="${tmpFile%.*}.gravity"
|
||||
|
||||
local timestamp
|
||||
timestamp="$(date --utc +'%s')"
|
||||
@ -502,6 +503,7 @@ gravity_DownloadBlocklistFromUrl() {
|
||||
# We don't use '--suffix' here because not all implementations of mktemp support it, e.g. on Alpine
|
||||
listCurlBuffer="$(mktemp -p "${GRAVITY_TMPDIR}")"
|
||||
mv "${listCurlBuffer}" "${listCurlBuffer%.*}.phgpb"
|
||||
listCurlBuffer="${listCurlBuffer%.*}.phgpb"
|
||||
|
||||
# Determine if $saveLocation has read permission
|
||||
if [[ -r "${saveLocation}" && $url != "file"* ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user