Skip to content

Commit

Permalink
fix error in trap
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmis committed Dec 7, 2017
1 parent 30eb909 commit 8e0860f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rootfs/waitjava.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash

function stop_minecraft() {
/etc/init.d/$1 stop
PROCNAME=$1

function stop_proc() {
/etc/init.d/$PROCNAME stop
exit
}

trap stop_minecraft SIGINT SIGTERM
trap stop_proc SIGINT SIGTERM

/etc/init.d/$1 start
/etc/init.d/$PROCNAME start

while true; do
if ps -ax | grep [0-9]\ /usr/bin/java | grep -q $2 ; then
Expand Down

0 comments on commit 8e0860f

Please sign in to comment.