Jboss启动&&停止

建两个shell脚本start.sh、stop.sh

[root@prjboss01 ~]# cat /opt/jboss/bin/start.sh 
#!/bin/bash
cd /opt/jboss/bin
nohup sh run.sh -b 0.0.0.0 &
echo "log:/opt/jboss/bin/nohup.out"
[root@prjboss01 ~]# cat /opt/jboss/bin/stop.sh 
#!/bin/bash
for i in `ps auxwww |grep -w 'jboss' |egrep -v 'grep|stop.sh'|awk '{print $2}'` ; do
kill -9 $i
done
rm /opt/jboss/server/default/data/* -rf
rm /opt/jboss/server/default/tmp/* -rf
rm /opt/jboss/server/default/work/* -rf
echo "clear database..."
for tb in `/usr/local/mysql/bin/mysql -A jbossdb -e "show tables" | sed '1d'`;do /usr/local/mysql/bin/mysql -A jbossdb -e "DROP TABLE $tb";done
echo "stop OK"

你可能感兴趣的:(mysql,jboss,脚本,bash)