-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflx-daemon
More file actions
executable file
·57 lines (49 loc) · 1.5 KB
/
flx-daemon
File metadata and controls
executable file
·57 lines (49 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
# Flamelex daemon launcher script
# This script manages Flamelex as a background daemon using the production release
set -e
# Get the directory where this script is located
FLAMELEX_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Change to the flamelex directory
cd "$FLAMELEX_DIR"
# Build release if it doesn't exist
if [ ! -d "_build/prod/rel/flamelex" ]; then
echo "Building production release..."
MIX_ENV=prod mix release
fi
# Function to show usage
usage() {
echo "Usage: $0 {start|stop|restart|status|console}"
echo " start - Start Flamelex as a daemon"
echo " stop - Stop the Flamelex daemon"
echo " restart - Restart the Flamelex daemon"
echo " status - Check if Flamelex is running"
echo " console - Start Flamelex with an interactive console"
exit 1
}
# Get command (default to start if none provided)
COMMAND="${1:-start}"
case "$COMMAND" in
start)
echo "Starting Flamelex daemon..."
./_build/prod/rel/flamelex/bin/flamelex daemon
;;
stop)
echo "Stopping Flamelex daemon..."
./_build/prod/rel/flamelex/bin/flamelex stop
;;
restart)
echo "Restarting Flamelex daemon..."
./_build/prod/rel/flamelex/bin/flamelex restart
;;
status)
./_build/prod/rel/flamelex/bin/flamelex ping
;;
console)
echo "Starting Flamelex with console..."
./_build/prod/rel/flamelex/bin/flamelex start
;;
*)
usage
;;
esac