create tmpfile on same volume as existing file

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2013-09-27 22:06:08 +02:00
parent 8a7639c191
commit d166224e68

View file

@ -47,7 +47,7 @@ remove_entry() {
prefix="#cdist:$__object_name" prefix="#cdist:$__object_name"
suffix="#/cdist:$__object_name" suffix="#/cdist:$__object_name"
cat << DONE cat << DONE
tmpfile=\$(mktemp) tmpfile=\$(mktemp ${file}.cdist.XXXXXXXXXX)
# preserve ownership and permissions by copying existing file over tmpfile # preserve ownership and permissions by copying existing file over tmpfile
cp -p "$file" "\$tmpfile" cp -p "$file" "\$tmpfile"
awk -v prefix="$prefix" -v suffix="$suffix" ' awk -v prefix="$prefix" -v suffix="$suffix" '