Skip to content

Commit

Permalink
Fixes and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Riniyar Kerendey committed Apr 4, 2019
1 parent f1eb5a8 commit eb5781e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hell
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

HELL_DIR=~/.hell
FILE_CONF=${HELL_DIR}/services.json
FILE_PID=${HELL}/pids.json
FILE_PID=${HELL_DIR}/pids.json

mkdir -p ${HELL_DIR}

Expand Down Expand Up @@ -109,7 +109,7 @@ hell_ctl() {
if [ ! -z ${SERVICE_PID} ] && kill -0 ${SERVICE_PID} > /dev/null 2> /dev/null ; then
echo "Service already running"
else
echo "starting ${SERVICE}"
echo "starting '${SERVICE}'"
cd `echo ${SERVICE_DATA} | jshon -Q -e dir -u`
local cmd=`echo ${SERVICE_DATA}|jshon -Q -e cmd -u`
local envfile=`echo ${SERVICE_DATA}|jshon -Q -e env -u`
Expand All @@ -132,7 +132,7 @@ hell_ctl() {

hell_ctl_stop() {
if [ ! -z ${SERVICE_PID} ] ; then
echo "stopping ${SERVICE}"
echo "stopping '${SERVICE}'"
local pids=`pgrep -P ${SERVICE_PID}`
kill ${SERVICE_PID} ${pids} > /dev/null 2> /dev/null
sleep 2
Expand All @@ -153,7 +153,7 @@ hell_ctl() {
}

hell_ctl_status() {
echo "status of ${SERVICE}"
echo "status of '${SERVICE}'"
if [ ! -z ${SERVICE_PID} ] ; then
if kill -0 ${SERVICE_PID} > /dev/null 2> /dev/null ; then
echo "Service is running"
Expand All @@ -173,7 +173,7 @@ hell_ctl() {
}

hell_ctl_reload() {
echo "reloading ${SERVICE}"
echo "reloading '${SERVICE}'"
if [ ! -z ${SERVICE_PID} ] && kill -0 ${SERVICE_PID} > /dev/null 2> /dev/null ; then
kill -1 ${SERVICE_PID}
else
Expand Down Expand Up @@ -219,7 +219,7 @@ hell_conf() {
fi
if [ -z ${ARGV_ENV} ] ; then
echo "arg -e was not passed."
echo "That's not a problem, u can update info later)."
echo "That's not a problem, u can update info later."
else
args+=(-s ${ARGV_ENV} -i env)
fi
Expand All @@ -229,7 +229,7 @@ hell_conf() {
else
local cfg="{}"
fi
echo ${cfg} | jshon -n '{}' ${args[@]} -i "${SERVICE}" > ${FILE_CONF}
echo ${cfg} | jshon ${args[@]} -i "${SERVICE}" > ${FILE_CONF}
}

hell_conf_update() {
Expand Down

0 comments on commit eb5781e

Please sign in to comment.