小编tom*_*ted的帖子

不知道为什么这个小shell脚本不起作用

我正在尝试制作一个小脚本来为我正在制作的 python 网站启动 gunicorn。我稍微修改了在https://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc 上找到的脚本。这是我的版本。

#!/bin/sh

GUNICORN=/usr/local/bin/gunicorn
ROOT=/srv/mobile-site/app
PID=/var/run/gunicorn.pid

APP=mobilecms:app

if [ -f $PID ]; then rm $PID fi        

cd $ROOT
exec $GUNICORN -b 127.0.0.1:8080 -w 8 -k gevent --pidfile=$PID $APP
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试运行脚本时,它显示此错误

/etc/init.d/gunicorn: 13: Syntax error: end of file unexpected (expecting "fi")
Run Code Online (Sandbox Code Playgroud)

有谁知道出了什么问题?

bash shell ubuntu-10.04

2
推荐指数
1
解决办法
1991
查看次数

标签 统计

bash ×1

shell ×1

ubuntu-10.04 ×1