Wednesday, March 28, 2007

Scrip shell bash sederhana untuk aplikasi java

          #!/bin/bash
export JAVA_HOME=/usr/local/java
CLASSPATH=ajarfile.jar:.

case $1 in
start)
echo $$ > /var/run/something.pid;
exec 2>&1 java -cp ${CLASSPATH} class.something.with.main \
1>/tmp/something.out
;;
stop)
kill `cat /var/run/something.pid` ;;
*)
echo "usage: something {start|stop}" ;;
esac

No comments:

Followers