[code]#!/bin/bash
#
### BEGIN INIT INFO
# Provides: atlassian
# Required-Start:
# Required-Stop:
# Should-Start: $mysql
# Should-Stop: $mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the Jira&Confluence server
# Description: Start and stop the Jira&Confluence server.
### END INIT INFO
#
tomcat=/home/jxb/apps/atlassian-jira-enterprise-3.6.5-standalone
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
export JAVA_HOME=/usr/lib/jvm/java-6-sun
start(){
echo -n $"Starting Jira&Confluence service: "
#daemon -c
$startup
RETVAL=$?
echo
}
stop(){
echo $"Stopping Jira&Confluence service: "
$shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
status(){
numproc=`ps -ef | grep atlassian-jira | grep -v "grep atlassian-jira" | wc -l`
if [ $numproc -gt 0 ]; then
echo "Jira&Confluence is running..."
else
echo "Jira&Confluence is stopped..."
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
[/code]
#
### BEGIN INIT INFO
# Provides: atlassian
# Required-Start:
# Required-Stop:
# Should-Start: $mysql
# Should-Stop: $mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the Jira&Confluence server
# Description: Start and stop the Jira&Confluence server.
### END INIT INFO
#
tomcat=/home/jxb/apps/atlassian-jira-enterprise-3.6.5-standalone
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
export JAVA_HOME=/usr/lib/jvm/java-6-sun
start(){
echo -n $"Starting Jira&Confluence service: "
#daemon -c
$startup
RETVAL=$?
echo
}
stop(){
echo $"Stopping Jira&Confluence service: "
$shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
status(){
numproc=`ps -ef | grep atlassian-jira | grep -v "grep atlassian-jira" | wc -l`
if [ $numproc -gt 0 ]; then
echo "Jira&Confluence is running..."
else
echo "Jira&Confluence is stopped..."
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
[/code]