From af4015891b1d2b04a8e70c95d73d3bbd4c8a64f9 Mon Sep 17 00:00:00 2001 From: pedro Date: Fri, 15 Mar 2024 09:33:23 +0100 Subject: [PATCH] web_cmd: trying to fix flag file situation --- web_cmd.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web_cmd.sh b/web_cmd.sh index 37a6873..9747a1c 100755 --- a/web_cmd.sh +++ b/web_cmd.sh @@ -9,17 +9,17 @@ main() { cmd="${1}" cd "$(dirname "${0}")" - flock=".web_command_lock" - if [ -f "${flock}" ]; then - content="$(cat "${flock}")" - echo "web command already requested: ${content}" + flagf=".web_command_lock" + if [ -f "${flagf}" ]; then + content="$(cat "${flagf}")" + printf "web command already requested:\n %s\n" "${content}" else - touch "${flock}" + printf "%s" "${cmd}" > "${flagf}" deployment="${deployment:-prod}" - echo "requested ${cmd}" + printf "requested command:\n %s\n" "${cmd}" ${cmd} & fi - rm "${flock}" + rm "${flagf}" }