Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Paste Description for BF2Server init scrip

BF2Server init script

BF2Server init scrip
Saturday, February 17th, 2007 at 7:53:16pm UTC 

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          battlefield
  4. # Required-Start:    networking
  5. # Required-Stop:
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:      S 0 1 6
  8. # Short-Description: Battlefield Server Daemon
  9. # Description:       Starts/Stops/Restarts the Battlefield2 Server Daemon
  10. ### END INIT INFO
  11.  
  12. set -e
  13.  
  14. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/bf2server/mono-1.1.12.1/bin
  15. DESC="Battlefield Server"
  16. NAME=bf2server
  17. USER=bf2server
  18. DIR=/home/bf2server/bf2
  19. DAEMON=mono
  20. PIDFILE=/var/run/$NAME.pid
  21. SCRIPTNAME=/etc/init.d/$NAME
  22. ARGUMENTS="$DIR/bf2ccd.exe"
  23.  
  24. # Gracefully exit if the package has been removed.
  25. # moot
  26. #test -x "$DAEMON" # || exit 0
  27.  
  28. d_start() {
  29. #        start-stop-daemon --start --quiet \
  30. #                --chuid $USER \
  31. #                --chdir $DIR \
  32. #                --exec "$DAEMON $ARGUMENTS" \
  33. #                > /dev/null \
  34. #                || echo -n " already running"
  35.         echo -en "running [$DAEMON $ARGUMENTS] "
  36.         $DAEMON $ARGUMENTS &> /dev/null &
  37.         echo "$!" | tee $PIDFILE.my
  38. }
  39.  
  40. d_stop() {
  41. #        start-stop-daemon --stop --quiet \
  42. #                --chuid $USER \
  43. #                --chdir $DIR \
  44. #                --exec "$DAEMON $ARGUMENTS" \
  45. #                || echo -n " not running"
  46.         kill -SIGTERM $(cat $PIDFILE.my)
  47. }
  48.  
  49. case "$1" in
  50.   start)
  51.         echo -n "Starting $DESC: $NAME"
  52.         d_start
  53.         echo "."
  54.         ;;
  55.   stop)
  56.         echo -n "Stopping $DESC: $NAME"
  57.         d_stop
  58.         echo "."
  59.         ;;
  60.   restart|force-reload)
  61.         echo -n "Restarting $DESC: $NAME"
  62.         d_stop
  63.         sleep 15
  64.         d_start
  65.         echo "."
  66.         ;;
  67.   *)
  68.         echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  69.         exit 3
  70.         ;;
  71. esac
  72.  
  73. exit 0

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right