-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathetc_init.d_dst
More file actions
executable file
·80 lines (68 loc) · 2.02 KB
/
etc_init.d_dst
File metadata and controls
executable file
·80 lines (68 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#! /bin/sh
### BEGIN INIT INFO
# Provides: dont_starve_together
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: little dst script
# Description: Little script file to control don't starve together servers
# meh.
### END INIT INFO
# Author: Norbert Ruehl <norbert_ruehl@linux.com>
#
# Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Description of the service"
NAME=dst
SCRIPTNAME=/etc/init.d/$NAME
SERVER_NAME="dst_1"
RUN_ORDER="cd /opt/dst/exec/bin && bash -c 'LD_LIBRARY_PATH=/opt/dst/dst_lib ./dontstarve_dedicated_server_nullrenderer -conf_dir $SERVER_NAME'"
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
#TODO check if rightfully source
if [ -z $path_for_dst ];
then echo "path_for_dst not set"
exit 3
fi
if [ -z $path_for_inst ];
then echo "path_for_inst not set"
exit 3
fi
if [ -z $name_of_dst_user ];
then echo "name_of_dst_user not set"
exit 3
fi
case "$1" in
info)
echo "path for dst: $path_for_dst"
echo "path for dst: $path_for_inst"
echo "config_might_be: $path_for_dst.klei"
echo "dst is used as: $name_of_dst_user"
;;
start)
# case "$?" in
# TODO check if nescesary files like script exists, and warn if not ,
echo "it's something..."
# TODO check which servers are there aaand already up etc
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/dst_$SERVER_NAME.pid --chuid $name_of_dst_user --exec /opt/dst/$SERVER_NAME.sh &
;;
stop)
echo "not yet implmenetd"
;;
status)
echo "not yet implemented"
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|info}" >&2
exit 3
;;
esac
: