aboutsummaryrefslogtreecommitdiffstats
path: root/community/minetest/minetest-server.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-11-09 10:41:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-11-09 10:41:26 +0000
commitbbaa3499a8032234fb44af5b951e8e73d10c57e2 (patch)
tree6e7ff2dca33a2696784b23fcede912ae42769e4f /community/minetest/minetest-server.initd
parent4491f635313e9c287c6b3789aae7fcdac3130c51 (diff)
downloadaports-bbaa3499a8032234fb44af5b951e8e73d10c57e2.tar.bz2
aports-bbaa3499a8032234fb44af5b951e8e73d10c57e2.tar.xz
community/minetest: move from main
Diffstat (limited to 'community/minetest/minetest-server.initd')
-rw-r--r--community/minetest/minetest-server.initd35
1 files changed, 35 insertions, 0 deletions
diff --git a/community/minetest/minetest-server.initd b/community/minetest/minetest-server.initd
new file mode 100644
index 0000000000..a8bca09a96
--- /dev/null
+++ b/community/minetest/minetest-server.initd
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+
+description="Minetest server"
+
+pidfile="/var/run/$SVCNAME.pid"
+command="/usr/bin/minetestserver"
+
+start_stop_daemon_args="--user ${USER:-minetest} --group ${GROUP:-games}
+ --make-pidfile --pidfile $pidfile --background --quiet --wait 300"
+command_args="$ARGS"
+
+
+depend() {
+ need net
+ after firewall
+}
+
+optional_command_arg() {
+ if [ -n "$2" ]; then
+ command_args="$command_args $1 $2"
+ fi
+}
+
+start_pre() {
+ optional_command_arg --log $LOG
+ optional_command_arg --config $CONFIG
+ optional_command_arg --gameid $GAMEID
+}
+
+reload() {
+ ebegin "Reloading $SVCNAME"
+ start-stop-daemon --signal HUP \
+ --exec "$EXEC" --pidfile "$pidfile"
+ eend $?
+}