Skip to content

Instantly share code, notes, and snippets.

@javiertoledo
Created October 24, 2010 00:19
Show Gist options
  • Save javiertoledo/642880 to your computer and use it in GitHub Desktop.
Save javiertoledo/642880 to your computer and use it in GitHub Desktop.
Init script for glassfish
#!/bin/sh
GLASSFISHPATH=/usr/share/glassfishv2/bin
GLASSFISHDOMAINHOME=/var/lib/glassfishv2/domains/domain1
case "$1" in
start)
echo "starting glassfish from $GLASSFISHPATH"
sudo -u glassfish $GLASSFISHPATH/asadmin start-domain --user admin --passwordfile ${GLASSFISHDOMAINHOME}/config/passwordfile domain1
;;
restart)
$0 stop
$0 start
;;
stop)
echo "stopping glassfish from $GLASSFISHPATH"
sudo -u glassfish $GLASSFISHPATH/asadmin stop-domain domain1
;;
*)
echo $"usage: $0 {start|stop|restart}"
exit 3
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment