Restart Script Needed

Discussion in 'Performance Tweaking' started by DistortedDorian, Aug 3, 2013.

  1. Hello, I tried make a restart script but it didn't go very well. Can someone explain how to make one?
     
  2. Dmck2b

    Services Staff

  3. Code (Text):
    #!/bin/sh
    BINDIR=$(dirname "$(readlink -fn "$0")")
    cd "\$BINDIR"
    while true
    do
        java  -server -Xms4G -Xmx8G -jar *.jar
        echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!"
        echo "Rebooting in:"
        for i in 5 4 3 2 1
        do
            echo "$i..."
            sleep 1
        done
        echo "Rebooting now!"
    done
     
     
  4. Thanks.