Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OLD :::
- cd /Applications/"Bukkit Server";
- sh launchserver.command;
- sleep 5; //allows the server (minecraft server) to get fully started before proceeding
- ps -axww | /usr/bin/grep 'java'; //searches through processes matching 'java'
- read $pid; //user enters the pid of the minecraft server process
- renice -20 $pid; //grants -20 priority to the minecraft process
- screen -aArd minecraft; //sends the user to the minecraft console, which has a screen attached to it
- ::::::
- new ::::
- #!/bin/sh
- cd /Applications/"Bukkit Server"
- #ensure the launcher is executable.
- #
- chmod 0755 launchserver.command
- #
- #next command all ready uses SCREEN
- ./launchserver.command >/dev/null 2>&1 &
- #sleep for a bit let it start up
- sleep 10
- #
- #find the pid of minecraft server, however it spawns 2 PIDs
- # we need to determine from minecraft which pid
- # should be sent the renice command. either ?? or the tty
- # find out from mindcraft support geeks
- #
- mypid=`ps -ef |grep minecraft | grep -v grep | awk '{print $2}'`
- # force renice of minecraft
- renice -20 $mypid
- #
- #optional, change to the screen where minecraft console is running
- #just remove the #
- #screen -aArd minecraft
- #
- #end of script
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement