add web_cmd
This commit is contained in:
parent
de3f6f077d
commit
8ad4f8fed6
26
web_cmd.sh
Normal file
26
web_cmd.sh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
# DEBUG
|
||||
#set -x
|
||||
|
||||
main() {
|
||||
cmd="${1}"
|
||||
|
||||
cd "$(dirname "${0}")"
|
||||
flock=".web_command_lock"
|
||||
if [ -f "${flock}" ]; then
|
||||
content="$(cat "${flock}")"
|
||||
echo "web command already requested: ${content}"
|
||||
else
|
||||
touch
|
||||
deployment="${deployment:-prod}"
|
||||
echo "requested ${cmd}"
|
||||
${cmd} &
|
||||
fi
|
||||
rm "${flock}"
|
||||
|
||||
}
|
||||
|
||||
main "${@}"
|
Reference in a new issue