2024-06-03 10:39:11 -04:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
description="multicraftserver daemon by MinenuX"
|
|
|
|
|
|
|
|
pidfile="/var/run/$SVCNAME.pid"
|
2024-06-04 15:26:57 -04:00
|
|
|
command="/usr/games/multicraftserver"
|
2024-06-03 10:39:11 -04:00
|
|
|
|
2024-06-04 15:26:57 -04:00
|
|
|
start_stop_daemon_args="--chdir /var/games/multicraft --user ${USER:-multicraft} --group ${GROUP:-games} --make-pidfile --pidfile $pidfile --background --quiet --wait 300"
|
2024-06-03 10:39:11 -04:00
|
|
|
command_args="$ARGS"
|
|
|
|
|
|
|
|
|
|
|
|
depend() {
|
2024-06-04 15:26:57 -04:00
|
|
|
need net
|
|
|
|
after firewall
|
2024-06-03 10:39:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
optional_command_arg() {
|
2024-06-04 15:26:57 -04:00
|
|
|
if [ -n "$2" ]; then
|
|
|
|
command_args="$command_args $1 $2"
|
|
|
|
fi
|
2024-06-03 10:39:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
2024-06-04 15:26:57 -04:00
|
|
|
optional_command_arg --world $WORLD
|
|
|
|
optional_command_arg --logfile $LOG
|
|
|
|
optional_command_arg --config $CONFIG
|
|
|
|
optional_command_arg --gameid $GAMEID
|
2024-06-03 10:39:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
2024-06-04 15:26:57 -04:00
|
|
|
ebegin "Reloading $SVCNAME"
|
|
|
|
start-stop-daemon --signal HUP --exec "$EXEC" --pidfile "$pidfile"
|
|
|
|
eend $?
|
2024-06-03 10:39:11 -04:00
|
|
|
}
|