Note that openbsd needs erlang-wx
[akkoma] / installation / freebsd / rc.d / akkoma
1 #!/bin/sh
2 # $FreeBSD$
3 # PROVIDE: akkoma
4 # REQUIRE: DAEMON postgresql
5 # KEYWORD: shutdown
6
7 # sudo -u akkoma MIX_ENV=prod elixir --erl \"-detached\" -S mix phx.server
8
9 . /etc/rc.subr
10
11 name=akkoma
12 rcvar=akkoma_enable
13
14 desc="Akkoma Social Media Platform"
15
16 load_rc_config ${name}
17
18 : ${akkoma_user:=akkoma}
19 : ${akkoma_home:=$(getent passwd ${akkoma_user} | awk -F: '{print $6}')}
20 : ${akkoma_chdir:="${akkoma_home}/akkoma"}
21 : ${akkoma_env:="HOME=${akkoma_home} MIX_ENV=prod"}
22
23 command=/usr/local/bin/elixir
24 command_args="--erl \"-detached\" -S /usr/local/bin/mix phx.server"
25 procname="*beam.smp"
26
27 run_rc_command "$1"