I have a start script for TeamSpeak3 server in /etc/init.d
that is run at the boot time.
#! /bin/sh ### BEGIN INIT INFO # Provides: ts3 # Required-Start: $network mysql # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: TeamSpeak3 Server Daemon # Description: Starts/Stops/Restarts the TeamSpeak Server Daemon ### END INIT INFO set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="TeamSpeak3 Server" NAME=teamspeak3-server USER=teamspeak3 DIR=/opt/teamspeak3-server OPTIONS=inifile=ts3server.ini DAEMON=$DIR/ts3server_startscript.sh #PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 sleep 2 sudo -u $USER $DAEMON $1 $OPTIONS
And I need this to happen:
- Run a script
./MyScript
that exits immediately and is located in TS3 directory - Wait some time
- Run the actual daemon that will stay running
I am not really good with Unix scripting, I just need to run a server with this. I might also mention that I am running latest Ubuntu.
Thanks for help, krejcar25