tinyfox for linux 独立版 fox.sh

#!/bin/sh

export LANG="zh_CN.UTF-8"
# export MONO_IOMAP="all"
# export MONO_EXTERNAL_ENCODINGS="gbk:gb18030:gb2312"
ulimit -SHn 20000 >/dev/null 2>&1

PORT=80

C_DIR=$(pwd)
TN_HOME=$(cd $(dirname $0);pwd)


if [ "$1" = "-b" ]; then
  cd ${TN_HOME}
  ${TN_HOME}/TinyFox -p ${PORT}  $@ >/dev/null 2>&1 &
  cd ${C_DIR}
  exit 0
fi

if [ "$1" = "stop" ]; then
  pid=$(ps -ef|grep ${TN_HOME}/TinyFox |grep -v 'grep'|awk '{print $2}')
  if [ "$pid" = "" ]; then
    echo "Can't Found...."
    exit 1
  fi

  kill -9 $pid
  exit 0
fi

cd ${TN_HOME}
${TN_HOME}/TinyFox  -p ${PORT} $@
cd ${C_DIR}

exit 0

 

posted @ 2016-04-14 11:11  b̶i̶n̶g̶.̶  阅读(357)  评论(0编辑  收藏  举报