clove/allInOne
start
#!/usr/bin/env bash
# start
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
if [[ ! -f .env && -z "${ADMIN_PASSWORD:-}" ]]; then
(umask 077; set -o noclobber; cat .env.example > .env) || test -f .env
printf 'Set ADMIN_PASSWORD in %s/.env, then run ./start again.\n' "$PWD" >&2
exit 1
fi
if [[ "${1:-}" == --build ]]; then
shift
./build
elif [[ ! -x target/release/proxybot || ! -f web/dist/index.html ]]; then
./build
fi
exec ./target/release/proxybot "$@"