aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-14 15:18:23 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-14 15:18:23 +0000
commitb504413c9cb6f67e413af5aad6cb791d4b1873a6 (patch)
tree5864cb5d98016eabaf7fece4a7f39d50410b8ef2
parent8157c5241125541ba267d8d9fff1cc9a6ebe3d52 (diff)
downloadpaludis-b504413c9cb6f67e413af5aad6cb791d4b1873a6.tar.gz
paludis-b504413c9cb6f67e413af5aad6cb791d4b1873a6.tar.xz
Be less racy.
-rwxr-xr-xhooks/demos/pretend_resume.bash.in3
1 files changed, 1 insertions, 2 deletions
diff --git a/hooks/demos/pretend_resume.bash.in b/hooks/demos/pretend_resume.bash.in
index 5e544bf..7c2003b 100755
--- a/hooks/demos/pretend_resume.bash.in
+++ b/hooks/demos/pretend_resume.bash.in
@@ -24,8 +24,7 @@ if [[ -n ${template} ]]; then
file=${template}
fi
- if echo "${RESUME_COMMAND}" >"${file}"; then
- chmod 644 "${file}"
+ if touch "${file}" && chmod 644 "${file}" && echo "${RESUME_COMMAND}" >"${file}"; then
echo "Resume command saved to file: ${file}"
else
echo "Resume command NOT saved to file: ${file}"