Skip to content

Instantly share code, notes, and snippets.

@knalli
Created August 7, 2011 12:22
Show Gist options
  • Save knalli/1130328 to your computer and use it in GitHub Desktop.
Save knalli/1130328 to your computer and use it in GitHub Desktop.
Atlassian Service Scripts
#!/bin/sh -e
# Confluence startup script
#chkconfig: 2345 80 05
#description: Confluence
#original found at: http://confluence.atlassian.com/display/DOC/Start+Confluence+automatically+on+Linux+and+UNIX
# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=confluence
# Name of the user to run as
USER=confluence
# Location of application's bin directory
CATALINA_HOME=/usr/local/confluence/current
# Location of Java JDK
export JAVA_HOME=/usr/lib/jvm/java-6-sun
case "$1" in
# Start command
start)
echo "Starting $APP"
/bin/su -m $USER -c "$CATALINA_HOME/bin/startup.sh &> /dev/null"
;;
# Stop command
stop)
echo "Stopping $APP"
/bin/su -m $USER -c "$CATALINA_HOME/bin/shutdown.sh &> /dev/null"
echo "$APP stopped successfully"
;;
# Restart command
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: /etc/init.d/$APP {start|restart|stop}"
exit 1
;;
esac
exit 0
#!/bin/bash
# Fisheye startup script
# chkconfig: 345 90 90
# description: Atlassian FishEye
# original found at: http://jarrod.spiga.id.au/?p=35
FISHEYE_USER=fisheye
FISHEYE_HOME=/opt/fisheye/fisheye/bin
start() {
echo "Starting FishEye: "
if [ "x$USER" != "x$FISHEYE_USER" ]; then
su - $FISHEYE_USER -c "$FISHEYE_HOME/fisheyectl.sh start"
else
$FISHEYE_HOME/fisheyectl.sh start
fi
echo "done."
}
stop() {
echo "Shutting down FishEye: "
if [ "x$USER" != "x$FISHEYE_USER" ]; then
su - $FISHEYE_USER -c "$FISHEYE_HOME/fisheyectl.sh stop"
else
$FISHEYE_HOME/fisheyectl.sh stop
fi
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment