27 lines
488 B
Bash
Executable File
27 lines
488 B
Bash
Executable File
#!/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 "${flock}"
|
|
deployment="${deployment:-prod}"
|
|
echo "requested ${cmd}"
|
|
${cmd} &
|
|
fi
|
|
rm "${flock}"
|
|
|
|
}
|
|
|
|
main "${@}"
|