summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-server/steamcmd/files/steamcmd.initd')
-rw-r--r--games-server/steamcmd/files/steamcmd.initd32
1 files changed, 32 insertions, 0 deletions
diff --git a/games-server/steamcmd/files/steamcmd.initd b/games-server/steamcmd/files/steamcmd.initd
new file mode 100644
index 000000000000..fecd30e3079b
--- /dev/null
+++ b/games-server/steamcmd/files/steamcmd.initd
@@ -0,0 +1,32 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ "${SVCNAME}" = "steamcmd" ]; then
+ instance="main"
+else
+ instance="${SVCNAME#steamcmd.}"
+fi
+
+name="SteamCMD (Mod: ${instance})"
+pidfile="/run/steamcmd.${instance}.pid"
+screen_name="steamcmd.${instance}"
+start_stop_daemon_args="--chdir ${STEAMCMD_PATH}"
+
+command="screen"
+command_args="-DmUS ${screen_name} ${STEAMCMD_PATH}/${STEAMCMD_BINARY} ${STEAMCMD_OPTS}"
+command_background="true"
+command_group="steamcmd"
+command_user="steamcmd"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ if [ -z "$STEAMCMD_BINARY" ] || [ -z "$STEAMCMD_PATH" ] || [ -z "$STEAMCMD_OPTS" ]; then
+ eerror "One or more STEAMCMD_* variables in /etc/conf.d/steamcmd.${SVCNAME} are not set!"
+ return 1
+ fi
+ return 0
+}