From a2b399246217101277fb8fd8922f2717443e81a1 Mon Sep 17 00:00:00 2001 From: Liam Crilly Date: Mon, 19 Dec 2022 15:03:55 +0000 Subject: [PATCH] Tools: unitc avoid interactive rm(1) invocations. --- tools/unitc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/unitc b/tools/unitc index 838f7ebf..bf12f111 100755 --- a/tools/unitc +++ b/tools/unitc @@ -161,7 +161,7 @@ if [ $REMOTE -eq 0 ]; then # Cache the discovery for this unit PID (and cleanup any old files) # - rm /tmp/${0##*/}.* 2> /dev/null + rm -f /tmp/${0##*/}.* 2> /dev/null echo UNIT_CTRL=\"${UNIT_CTRL}\" > /tmp/${0##*/}.$PID.env echo ERROR_LOG=${ERROR_LOG} >> /tmp/${0##*/}.$PID.env fi @@ -221,11 +221,11 @@ if [ $CURL_STATUS -ne 0 ]; then echo "${0##*/}: Check that you have permission to access the Unit control socket, or try again with sudo(8)" else echo "${0##*/}: Trying to access $UNIT_CTRL$URI" - cat /tmp/${0##*/}.$$ && rm /tmp/${0##*/}.$$ + cat /tmp/${0##*/}.$$ && rm -f /tmp/${0##*/}.$$ fi exit 4 fi -rm /tmp/${0##*/}.$$ 2> /dev/null +rm -f /tmp/${0##*/}.$$ 2> /dev/null if [ $SHOW_LOG -gt 0 ] && [ $NOLOG -eq 0 ] && [ $QUIET -eq 0 ]; then echo -n "${0##*/}: Waiting for log..."