NAVIGATION
Home
Gallery
Java
Linux
Web
Scripts And Utilities
Mobile And Sms
Misc
Contact
pixelWIKI
Nabaz Tag




<<

Jboss Launch Script

This script can be used to start and stop JBoss easily. Use:

jboss start
jboss stop
jboss restart
jboss log


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
!/bin/sh

JBOSS_PATH=/jboss/jboss
JBOSS_SH=run.sh

clean() {
	clear
	echo "Cleaning JBoss"
	rm -f  $JBOSS_PATH/server/all/farm/*.ear
	rm -fR $JBOSS_PATH/server/all/tmp/
	rm -fR $JBOSS_PATH/server/all/work/
}

check() {
	if ps -C $JBOSS_SH ; then
		clear
		echo "JBoss appears to be running already, is you are sure this is not the case, use $0 force"
		echo " N.B. JBoss is running as run.sh"
		exit
	fi
}

start() {
	clear
	echo "Starting JBoss"
	cd $JBOSS_PATH/bin
	./$JBOSS_SH -c all > /dev/null 2>&1 &
	log
}

stop() {
	clear
	echo "Stopping JBoss"
	$JBOSS_PATH/bin/shutdown.sh -S
}

log() {
	tail -f $JBOSS_PATH/server/all/log/server.log
}

case "$1" in

	clean)
		clean
		;;
	force)
		start
		;;
	start)
		check
		start
		;;
	stop)
		stop
		;;
	log)
		clear
		log
		;;
	*)
		echo $"Usage: $0 {clean|force|start|stop|log}"
esac