web_cmd: trying to fix flag file situation
This commit is contained in:
parent
9d036f9ad5
commit
af4015891b
14
web_cmd.sh
14
web_cmd.sh
|
@ -9,17 +9,17 @@ main() {
|
||||||
cmd="${1}"
|
cmd="${1}"
|
||||||
|
|
||||||
cd "$(dirname "${0}")"
|
cd "$(dirname "${0}")"
|
||||||
flock=".web_command_lock"
|
flagf=".web_command_lock"
|
||||||
if [ -f "${flock}" ]; then
|
if [ -f "${flagf}" ]; then
|
||||||
content="$(cat "${flock}")"
|
content="$(cat "${flagf}")"
|
||||||
echo "web command already requested: ${content}"
|
printf "web command already requested:\n %s\n" "${content}"
|
||||||
else
|
else
|
||||||
touch "${flock}"
|
printf "%s" "${cmd}" > "${flagf}"
|
||||||
deployment="${deployment:-prod}"
|
deployment="${deployment:-prod}"
|
||||||
echo "requested ${cmd}"
|
printf "requested command:\n %s\n" "${cmd}"
|
||||||
${cmd} &
|
${cmd} &
|
||||||
fi
|
fi
|
||||||
rm "${flock}"
|
rm "${flagf}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue