daily pastebin goal
4%
SHARE
TWEET

/etc/rc.d/minecraft-server

a guest Feb 18th, 2011 193 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. . /etc/rc.conf
  4. . /etc/rc.d/functions
  5.  
  6. case "$1" in
  7.   start)
  8.     stat_busy "Starting minecraft-server"
  9.     if $(ck_daemon minecraft-server); then
  10.       nohup /usr/bin/minecraft-server &> /dev/null &
  11.     fi
  12.     if [ $? -gt 0 ]; then
  13.       stat_fail
  14.     else
  15.       add_daemon minecraft-server
  16.       stat_done
  17.     fi
  18.     ;;
  19.   stop)
  20.     stat_busy "Stopping minecraft-server"
  21.     ck_daemon minecraft-server || ps ax | awk '/java.*minecraft-server/ {print $1}' | xargs kill
  22.     rm_daemon minecraft-server
  23.     stat_done
  24.     ;;
  25.   restart)
  26.     $0 stop
  27.     sleep 1
  28.     $0 start
  29.     ;;
  30.   status)
  31.     stat_busy 'Checking minecraft-server status'
  32.     ck_status minecraft-server
  33.     ;;
  34.   *)
  35.     echo "usage: $0 {start|stop|restart|status}"
  36. esac
  37. exit 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top