Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1.  
  2. OLD :::
  3. cd /Applications/"Bukkit Server";
  4. sh launchserver.command;
  5. sleep 5; //allows the server (minecraft server) to get fully started before proceeding
  6. ps -axww | /usr/bin/grep 'java'; //searches through processes matching 'java'
  7. read $pid; //user enters the pid of the minecraft server process
  8. renice -20 $pid; //grants -20 priority to the minecraft process
  9. screen -aArd minecraft; //sends the user to the minecraft console, which has a screen attached to it
  10.  
  11. ::::::
  12.  
  13. new ::::
  14.  
  15. #!/bin/sh
  16. cd /Applications/"Bukkit Server"
  17. #ensure the launcher is executable.
  18. #
  19. chmod 0755 launchserver.command
  20. #
  21. #next command all ready uses SCREEN
  22. ./launchserver.command >/dev/null 2>&1 &
  23. #sleep for a bit let it start up
  24. sleep 10
  25. #
  26. #find the pid of minecraft server, however it spawns 2 PIDs
  27. # we need to determine from minecraft which pid
  28. # should be sent the renice command. either ?? or the tty
  29. # find out from mindcraft support geeks
  30. #
  31. mypid=`ps -ef |grep minecraft | grep -v grep | awk '{print $2}'`
  32. # force renice of minecraft
  33. renice -20 $mypid
  34. #
  35. #optional, change to the screen where minecraft console is running
  36. #just remove the #
  37. #screen -aArd minecraft
  38. #
  39. #end of script
  40. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement