25 lines
532 B
Plaintext
25 lines
532 B
Plaintext
|
#!/sbin/openrc-run
|
||
|
# Copyright 2020 Gentoo Authors
|
||
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
name="factorio daemon"
|
||
|
description="2D infinite game"
|
||
|
command="${FACTORIO_PATH}/bin/x64/factorio"
|
||
|
command_args="${factorio_args}"
|
||
|
|
||
|
command_background=1
|
||
|
directory="${FACTORIO_PATH}"
|
||
|
pidfile="/run/${RC_SVCNAME}.pid"
|
||
|
|
||
|
command_user="${FACTORIO_USER:-root}"
|
||
|
command_group="${FACTORIO_GROUP:-root}"
|
||
|
|
||
|
depend() {
|
||
|
need net
|
||
|
}
|
||
|
|
||
|
start_pre() {
|
||
|
checkpath -d -m 0750 -o "${command_user}:${command_group}" \
|
||
|
"${directory}"
|
||
|
}
|