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:
rcourtman 2025-11-14 22:44:33 +00:00
parent 3a381e764a
commit c5a5eb2534

View file

@ -68,9 +68,9 @@ update_allowed_nodes() {
shift
local nodes=("$@")
# Create temp file
# Create temp file with unique prefix to avoid conflicts
local tmp_config
tmp_config=$(mktemp)
tmp_config=$(mktemp /tmp/pulse-config.XXXXXXXXXX)
# Ensure temp file is cleaned up on exit (success or failure)
trap "rm -f '$tmp_config'" RETURN