fix script
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/dda5ee4f Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/dda5ee4f Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/dda5ee4f Branch: refs/heads/inverted-index Commit: dda5ee4f213c5df73d3791e1444b53cfe191e4ff Parents: c714097 Author: qianhao.zhou <qianz...@ebay.com> Authored: Wed Feb 11 15:47:00 2015 +0800 Committer: qianhao.zhou <qianz...@ebay.com> Committed: Wed Feb 11 15:47:00 2015 +0800 ---------------------------------------------------------------------- bin/stop-kylin.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dda5ee4f/bin/stop-kylin.sh ---------------------------------------------------------------------- diff --git a/bin/stop-kylin.sh b/bin/stop-kylin.sh index 4ac8b7c..c7a61b2 100755 --- a/bin/stop-kylin.sh +++ b/bin/stop-kylin.sh @@ -1,12 +1,18 @@ #!/bin/sh -pid=`cat ${KYLIN_HOME}/pid || echo "no pid found";exit 1` -if [ ! "$pid" = "" ] +if [ ! -f "${KYLIN_HOME}/pid" ] then echo "no pid found" exit 1 +fi + +pid=`cat ${KYLIN_HOME}/pid` +if [ "$pid" = "" ] +then + echo "pid is empty" + exit 1 else - echo "stopping pid:$pid" + echo "stopping kylin:$pid" kill $pid fi rm ${KYLIN_HOME}/pid