#!/bin/sh
# Send command(s) to running daemonded instance started as a service
#
test -s /etc/sysconfig/unvanquished-server && . /etc/sysconfig/unvanquished-server

service_state=$(systemctl is-active unvanquished-server.service)
if [ "${service_state}" != "active" ]; then
	echo "No active instance of unvanquished-server, Exiting."
    exit 1
fi

# Administer running service instance - To send it commands.
#   -homepath must be same as running instance
exec /usr/lib64/unvanquished/daemonded -libpath $LIBPATH -pakpath $PAKPATH -homepath $HOMEPATH "$@"

