涛子 - 简单就是美

成单纯魁增,永继振国兴,克复宗清政,广开家必升

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

centos 6x

#!/bin/sh
# chkconfig: 123456 90 10
# TTS Server for Speech Synthesis
#
workdir=/etc/speech
 
start() {
    cd $workdir
    /usr/bin/python /etc/speech/TTSserver.py &
    echo "Server started."
}
 
stop() {
    pid=`ps -ef | grep '[p]ython /etc/speech/TTSserver.py' | awk '{ print $2 }'`
    echo $pid
    kill $pid
    sleep 2
    echo "Server killed."
}
 
case "$1" in
  start)
    start
    ;;
  stop)
    stop   
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo "Usage: /etc/init.d/tornado-tts {start|stop|restart}"
    exit 1
esac
exit 0
posted on 2017-08-16 18:05  北京涛子  阅读(246)  评论(0编辑  收藏  举报