-
-
Save kaloyan-raev/e2201049e3c76fad2714811c6a07bd6e to your computer and use it in GitHub Desktop.
Eclipse Che service script for AWS
This file contains 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 | |
### BEGIN INIT INFO | |
# Provides: che | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Eclipse Che | |
# Description: Starts and stops Eclipse Che | |
# | |
### END INIT INFO | |
export CHE_HOME=/opt/che | |
export JAVA_HOME=/opt/jre1.8.0_112 | |
do_start() | |
{ | |
export CHE_IP=`curl -s http://169.254.169.254/latest/meta-data/public-ipv4` | |
su ubuntu -c "$CHE_HOME/bin/che.sh start" | |
} | |
do_stop() | |
{ | |
su ubuntu -c "$CHE_HOME/bin/che.sh stop" | |
} | |
case "$1" in | |
start) | |
do_start | |
;; | |
stop) | |
do_stop | |
sleep 10 | |
;; | |
restart) | |
do_stop | |
sleep 20 | |
do_start | |
;; | |
*) | |
echo "Usage: che {start|stop|restart}" >&2 | |
exit 3 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment