=^.^=

A Tidy Little OpenRC (Gentoo) init Script for TeamSpeak3

karma

I recently set up a TeamSpeak3 server for the YI Minecraft users. Due to a crazy high-load-but-low-CPU-utlization problem I have decided to ditch ts3 and try Mumble.

Before I remove it, here's the qick and clean init script I made (assumes ts3 was installed to /opt/ts3/ and a non-privileged user called ts3 has been made):

#!/sbin/runscript
# Copyright (c) 2013 http://foxpa.ws
# All rights released

description="Runs TeamSpeak3 on Gentoo"

depend()
{
        need net
}

start()
{
        ebegin "Starting TeamSpeak3"
        start-stop-daemon --start --quiet --user=ts3 --background --chdir=/opt/ts3/ --exec "/opt/ts3/ts3server_startscript.sh" -- start
        eend ${?}
}

stop()
{
        ebegin "Stopping TeamSpeak3"
        cd /opt/ts3/
        start-stop-daemon --stop --quiet --exec "/opt/ts3/ts3server_startscript.sh" -- stop
        /opt/ts3/ts3server_startscript.sh stop &> /dev/null
        eend ${?}
}

Comments

There are no comments for this item.