Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- ### BEGIN INIT INFO
- # Provides: srcds_run
- # Required-Start: $local_fs $remote_fs
- # Required-Stop: $local_fs $remote_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: S 0 1 6
- # Short-Description: CS Source Dedicated Server
- # Description: This runs a srcds Counter Strike Source Dedicated Server.
- ### END INIT INFO
- # Author: Ryan Noblett <ryanra2@netscape.net>
- #
- # I didn't write srcds, just this init script.
- # I take no credit for anything other than this script.
- do_start()
- {
- echo -n "Starting Counter-Strike Source Server..."
- sleep 1
- cd /home/srcds
- su -c "SHELL=/home/srcds/srcds.sh screen -dm -S srcds" ryan
- # su -c "/home/srcds/srcds.sh" ryan
- echo "done."
- }
- #
- # Function that stops the daemon/service
- #
- do_stop()
- {
- echo -n "Stopping Counter-Strike Source Server..."
- sleep 1
- killall srcds_amd
- killall srcds_run
- echo "done."
- }
- case "$1" in
- start)
- do_start
- ;;
- stop)
- do_stop
- ;;
- restart|force-reload)
- do_stop
- sleep 1
- do_start
- ;;
- *)
- echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
- exit 3
- ;;
- esac
- :
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement