Skip to content

Instantly share code, notes, and snippets.

@aaronwalker
Created August 20, 2013 00:15
Show Gist options
  • Select an option

  • Save aaronwalker/6275695 to your computer and use it in GitHub Desktop.

Select an option

Save aaronwalker/6275695 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# chkconfig: 345 88 12
# description: Karaf is a java container.
### BEGIN INIT INFO
# Provides: $activemq
### END INIT INFO
. /etc/init.d/functions
. /etc/profile.d/java.sh
RETVAL=0
umask 077
start() {
echo -n $"Starting Karaf (fuseMQ): "
su -c /opt/fuse/fuse-mq-7.0.2.fuse-097/bin/start fusemq
echo
return $RETVAL
}
stop() {
echo -n $"Shutting down Karaf (fuseMQ): "
su -c /opt/fuse/fuse-mq-7.0.2.fuse-097/bin/stop fusemq
echo
return $RETVAL
}
client() {
echo -n $"Starting Karaf client (fuseMQ) "
su -c /opt/fuse/fuse-mq-7.0.2.fuse-097/bin/client fusemq
echo
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
client)
client
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|client|restart}"
exit 1
esac
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment