Teamspeak start stop script

After my server was restarted twice by my hosting center I decided to make sure Teamspeak would start automatically. I read a few posts on how other people did it but in the end I decided that I created my own minimal script.

My two goals with this init script was:

Init script (/etc/init.d/teamspeak):



# Make sure that Teamspeak starts even though it wasn't closed nicely last time (ie. by a power cut)
if [ $(su - $TEAMSPEAK_USER -c "ps ux" |grep|grep -v grep|wc -l) -eq 0 ] && [ -f ${TEAMSPEAK_DIR}/ ]
    rm ${TEAMSPEAK_DIR}/

su - $TEAMSPEAK_USER -c "./teamspeak2-server_startscript $1"
cd -
Creative Commons License
Teamspeak start stop script by Jacob Emcken is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.