mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-29 17:43:18 +00:00
Use suffixed temp file (#5457)
This commit is contained in:
commit
4c4a2ad5bd
1 changed files with 2 additions and 0 deletions
|
@ -141,6 +141,7 @@ database_table_from_file() {
|
||||||
# implementations of mktemp support it, e.g. on Alpine
|
# implementations of mktemp support it, e.g. on Alpine
|
||||||
tmpFile="$(mktemp -p "${GRAVITY_TMPDIR}")"
|
tmpFile="$(mktemp -p "${GRAVITY_TMPDIR}")"
|
||||||
mv "${tmpFile}" "${tmpFile%.*}.gravity"
|
mv "${tmpFile}" "${tmpFile%.*}.gravity"
|
||||||
|
tmpFile="${tmpFile%.*}.gravity"
|
||||||
|
|
||||||
local timestamp
|
local timestamp
|
||||||
timestamp="$(date --utc +'%s')"
|
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
|
# We don't use '--suffix' here because not all implementations of mktemp support it, e.g. on Alpine
|
||||||
listCurlBuffer="$(mktemp -p "${GRAVITY_TMPDIR}")"
|
listCurlBuffer="$(mktemp -p "${GRAVITY_TMPDIR}")"
|
||||||
mv "${listCurlBuffer}" "${listCurlBuffer%.*}.phgpb"
|
mv "${listCurlBuffer}" "${listCurlBuffer%.*}.phgpb"
|
||||||
|
listCurlBuffer="${listCurlBuffer%.*}.phgpb"
|
||||||
|
|
||||||
# Determine if $saveLocation has read permission
|
# Determine if $saveLocation has read permission
|
||||||
if [[ -r "${saveLocation}" && $url != "file"* ]]; then
|
if [[ -r "${saveLocation}" && $url != "file"* ]]; then
|
||||||
|
|
Loading…
Reference in a new issue