Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Gamle

Pages: [1]
1
Create JTS3ServerMod as a service.
nano /etc/init.d/jts3servermod
Copy the service script and paste it. Then save the file.
chmod 755 /etc/init.d/jts3servermod
chkconfig --add jts3servermod

// If you want the bot to automatic start on system boot.
chkconfig --level 2345 jts3servermod on

Service script
Code: [Select]
#!/bin/sh
# chkconfig: 2345 99 10
USER="ts3bot"
TS3BOT='/home/ts3bot/JTS3ServerMod'
STARTSCRIPT="$TS3BOT/jts3servermod_startscript.sh"
cd $TS3BOT
case "$1" in
'start')
su $USER -c "$STARTSCRIPT start"
;;
'stop')
su $USER -c "$STARTSCRIPT stop"
;;
'restart')
su $USER -c "$STARTSCRIPT restart"
;;
'status')
su $USER -c "$STARTSCRIPT status"
;;
'java')
su $USER -c "$STARTSCRIPT status"
;;
*)
echo "Usage $0 start|stop|restart|status|java"
esac

ATTENTION: I'm not a extremely experienced linux user, so there can be some code/command mistake. I just share the code for the people there can't create a service script by them self.

Pages: [1]