auto.sh 524 Bytes
# !/bin/bash
if [ ! -n "$1" ]; then
   echo "params error"
   exit 1
elif [ $1 != "api-qixi" ]; then
   echo "please input api-qixi"
   exit 2
fi
if [ ! -n "$2" ]; then
   echo "params error"
   exit 1
elif [ $2 != "start" -a $2 != "restart" -a $2 != "stop" ]; then
   echo "please input start|stop|restart"
   exit 2
fi


sh /sh/qixi/git.sh
if [ $? -ne 0 ];then
   exit 3
fi

binname=$1
sh /sh/qixi/build.sh ${binname}
if [ $? -ne 0 ];then
   exit 1
fi


sleep 1s
sh /sh/qixi/${1}.sh ${2}
if [ $? -ne 0 ];then
   exit 1
fi