Skip to content

Instantly share code, notes, and snippets.

@CodingFabian
Created December 1, 2015 10:02
Show Gist options
  • Save CodingFabian/90d46cfdce0085ee004c to your computer and use it in GitHub Desktop.
Save CodingFabian/90d46cfdce0085ee004c to your computer and use it in GitHub Desktop.
#!/bin/bash
export JAVA_HOME=/opt/jdk1.8.0_60
KARAF_HOME=/opt/apache-karaf
$KARAF_HOME/bin/status > /dev/null
case $1 in
start)
if [ "$?" -eq "1" ]; then
rm -f $KARAF_HOME/data/logs/*
$KARAF_HOME/bin/start
else
echo "Already running ..."
exit 0
fi
;;
stop)
if [ "$?" -eq "0" ]; then
$KARAF_HOME/bin/stop
else
echo "Not running ..."
exit 1
fi
;;
restart)
$KARAF_HOME/bin/stop
$KARAF_HOME/bin/start
;;
status)
$KARAF_HOME/bin/status
;;
*)
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment