-
-
Save luishdez/3805534 to your computer and use it in GitHub Desktop.
JIRA startup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -e | |
| # JIRA startup script | |
| #chkconfig: 2345 80 05 | |
| #description: JIRA | |
| # Define some variables | |
| # Name of app ( JIRA, Confluence, etc ) | |
| APP=jira | |
| # Name of the user to run as | |
| USER=jira | |
| # Location of application's bin directory | |
| BASE=/opt/atlassian/jira/current | |
| JIRA_HOME=/opt/atlassian/jira/current/home | |
| export $JIRA_HOME | |
| case "$1" in | |
| # Start command | |
| start) | |
| echo "Starting $APP" | |
| /bin/su -m $USER -c "cd $BASE/logs && $BASE/bin/startup.sh &> /dev/null" | |
| ;; | |
| # Stop command | |
| stop) | |
| echo "Stopping $APP" | |
| /bin/su -m $USER -c "$BASE/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment