Skip to content

Instantly share code, notes, and snippets.

@mosabua
Created September 18, 2013 22:57
Show Gist options
  • Save mosabua/6616904 to your computer and use it in GitHub Desktop.
Save mosabua/6616904 to your computer and use it in GitHub Desktop.
Simplistic startup script for Sonatype CLM Server
#!/bin/sh
SONATYPE_CLM_SERVER_HOME=/opt/tools/sonatype-clm-server
VERSION=1.6.0-02
JAVA_OPTIONS="-Xmx1024m -XX:MaxPermSize=128m"
do_start()
{
cd $SONATYPE_CLM_SERVER_HOME
java -jar $JAVA_OPTIONS sonatype-clm-server-$VERSION.jar server config.yml > /dev/null 2>&1 &
echo "Started Sonatype CLM Server"
}
do_console()
{
cd $SONATYPE_CLM_SERVER_HOME
java -jar $JAVA_OPTIONS sonatype-clm-server-$VERSION.jar server config.yml
}
do_stop()
{
pid=`ps aux | grep sonatype-clm-server | grep -v grep | awk '{print $2}'`
kill -9 $pid
echo "Killed Sonatype CLM Server - PID $pid"
}
do_usage()
{
echo "Usage: clm [console|start|stop]"
}
case $1 in
console) do_console
;;
start) do_start
;;
stop) do_stop
;;
*) do_usage
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment