From dff5ee18debb328ca95a0140ec18576de9d91598 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 17 Jan 2018 10:29:08 -0800 Subject: use TMPDIR correctly in initscript Signed-off-by: Lamont Granquist --- spec/functional/assets/chefinittest | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'spec/functional/assets') diff --git a/spec/functional/assets/chefinittest b/spec/functional/assets/chefinittest index 79e064cd5f..2539b018f0 100755 --- a/spec/functional/assets/chefinittest +++ b/spec/functional/assets/chefinittest @@ -1,15 +1,17 @@ #!/bin/ksh +TMPDIR="${TMPDIR:-/tmp}" + function create_chef_txt { - touch /tmp/chefinittest.txt + touch $TMPDIR/chefinittest.txt } function delete_chef_txt { - rm /tmp/chefinittest.txt + rm $TMPDIR/chefinittest.txt } function rename_chef_txt { - mv /tmp/chefinittest.txt /tmp/$1 + mv $TMPDIR/chefinittest.txt /tmp/$1 } case "$1" in @@ -20,7 +22,7 @@ stop ) delete_chef_txt ;; status ) - [ -f /tmp/chefinittest.txt ] || [ -f /tmp/chefinittest_reload.txt ] || [ -f /tmp/chefinittest_restart.txt ] + [ -f $TMPDIR/chefinittest.txt ] || [ -f $TMPDIR/chefinittest_reload.txt ] || [ -f $TMPDIR/chefinittest_restart.txt ] ;; reload ) rename_chef_txt "chefinittest_reload.txt" -- cgit v1.2.1