Skip to content

Commit

Permalink
better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Mar 12, 2015
1 parent 9d2516a commit c006aac
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bin/kong
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
export KONG_HOME="$(echo $SCRIPT_DIR | sed -e 's/\/[^\/]*$//')"

# Properties
# Setting configuration path
if [ -f /etc/kong.yml ]; then
export KONG_CONF=/etc/kong.yml
printf "Giving priority to configuration stored at "$KONG_CONF" - To override use -c option\n"
else
export KONG_CONF=$KONG_HOME/kong.yml
fi

# Setting nginx output path
nginx_output=$(lua -e "print(require('yaml').load(require('kong.tools.utils').read_file('$KONG_CONF')).output)")
if [ "$nginx_output" == "nil" ]; then
export NGINX_TMP=$KONG_HOME/nginx_tmp
Expand Down Expand Up @@ -44,6 +45,11 @@ function real_path_func {
fi
}

function print_start_error {
printf "Starting Kong"
printf "$(tput setaf 1) [$1]\n$(tput sgr 0)"
}

##############
# Operations #
##############
Expand All @@ -68,11 +74,6 @@ function show_version {
printf "Kong version: 0.0.1beta-1\n"
}

function print_start_error {
printf "Starting Kong"
printf "$(tput setaf 1) [$1]\n$(tput sgr 0)"
}

function start {
if [ -f $PID ]; then
if ps -p $(cat $PID) > /dev/null
Expand Down

0 comments on commit c006aac

Please sign in to comment.