Use unique temp file prefix to avoid permission conflicts
- Change mktemp to use /tmp/pulse-config.XXXXXXXXXX template - Prevents conflicts with stale temp files from previous runs - Fixes 'Permission denied' errors when script re-runs
This commit is contained in:
parent
3a381e764a
commit
c5a5eb2534
1 changed files with 2 additions and 2 deletions
|
|
@ -68,9 +68,9 @@ update_allowed_nodes() {
|
||||||
shift
|
shift
|
||||||
local nodes=("$@")
|
local nodes=("$@")
|
||||||
|
|
||||||
# Create temp file
|
# Create temp file with unique prefix to avoid conflicts
|
||||||
local tmp_config
|
local tmp_config
|
||||||
tmp_config=$(mktemp)
|
tmp_config=$(mktemp /tmp/pulse-config.XXXXXXXXXX)
|
||||||
|
|
||||||
# Ensure temp file is cleaned up on exit (success or failure)
|
# Ensure temp file is cleaned up on exit (success or failure)
|
||||||
trap "rm -f '$tmp_config'" RETURN
|
trap "rm -f '$tmp_config'" RETURN
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue