27 lines
537 B
Bash
Executable File
27 lines
537 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
set -u
|
|
# DEBUG
|
|
set -x
|
|
|
|
main() {
|
|
cmd="${1}"
|
|
|
|
cd "$(dirname "${0}")"
|
|
flagf=".web_command_lock"
|
|
if [ -f "${flagf}" ]; then
|
|
content="$(cat "${flagf}")"
|
|
printf "web command already requested:\n %s\n" "${content}"
|
|
else
|
|
printf "%s" "${cmd}" > "${flagf}"
|
|
deployment="${deployment:-prod}"
|
|
printf "requested command:\n %s\n" "${cmd}"
|
|
${cmd} &
|
|
fi
|
|
rm "${flagf}"
|
|
|
|
}
|
|
|
|
main "${@}"
|