This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
idhub-docker/web_cmd.sh
2024-03-15 09:37:04 +01:00

26 lines
542 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}
rm "${flagf}"
fi
}
main "${@}"