Skip to content

Instantly share code, notes, and snippets.

@alexandrusavin
Created January 29, 2014 16:36
Show Gist options
  • Save alexandrusavin/8691835 to your computer and use it in GitHub Desktop.
Save alexandrusavin/8691835 to your computer and use it in GitHub Desktop.
Wrapper script for starting/stopping Glassfish3 application with supervisord
#!/bin/bash
pidfile=/path/to/the/pidfile
function stopDomain {
echo "Sutting down domain."
/path/to/bin/asadmin stop-domain name
}
function startDomain {
echo "Starting zoobe domain"
/path/to/bin/asadmin start-domain name
while [ -e ${pidfile} ]; do sleep 0.1; done
}
trap stopDomain HUP INT QUIT ABRT KILL ALRM TERM TSTP
startDomain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment