Bump version
[akkoma] / installation / openbsd / rc.d / akkomad
1 #!/bin/ksh
2 #
3 # Default init file for Akkoma on OpenBSD
4 #
5 # Simple installation instructions:
6 # 1. Install Akkoma per wiki instructions
7 # 2. Place this akkomad file in /etc/rc.d
8 # 3. Enable and start Akkoma
9 # # doas rcctl enable akkomad
10 # # doas rcctl start akkomad
11 #
12
13 daemon="/usr/local/bin/elixir"
14 daemon_flags="--detached -S /usr/local/bin/mix phx.server"
15 daemon_user="_akkoma"
16
17 . /etc/rc.d/rc.subr
18
19 rc_reload=NO
20 pexp="phx.server"
21
22 rc_check() {
23 pgrep -q -U _akkoma -f "phx.server"
24 }
25
26 rc_start() {
27 ${rcexec} "cd akkoma; ${daemon} ${daemon_flags}"
28 }
29
30 rc_stop() {
31 pkill -q -U _akkoma -f "phx.server"
32 }
33
34 rc_cmd $1