Skip to content

Instantly share code, notes, and snippets.

@vanduc1102
Last active September 24, 2015 02:13
Show Gist options
  • Save vanduc1102/4cacc316be7911ef3a97 to your computer and use it in GitHub Desktop.
Save vanduc1102/4cacc316be7911ef3a97 to your computer and use it in GitHub Desktop.
Batch forced restart Jboss on Linux
#!/bin/bash
# This batch created by follwed these documents
# 1. http://oracleflash.com/20/How-to-kill-all-processes-with-one-command-in-Linux.html
# 2. http://www.thegeekstuff.com/2010/01/awk-introduction-tutorial-7-awk-print-examples/
#
echo "Start restart jboss"
kill -9 `ps aux | grep jboss | awk '$NF ~/jboss-as-7.1.1/ {print $2}'`
echo "Stopped jboss. Relax in 3 seconds."
sleep 3
echo "Start jboss"
standalone.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment