这是从 Atlassian 下载的一个简单的 shell 脚本,并稍作调整以满足目前发现的所有建议:
#!/bin/sh
# RUN_AS: The user to run fisheye as. Its recommended that you create a separate user account for security reasons
RUN_AS=fisheye
# FISHEYE_HOME: The path to the FishEye installation. Its recommended to create a symbolic link to the latest version so
# the process will still work after upgrades.
FISHEYE_HOME="/opt/atlassian/fisheye"
fisheyectl() {
ARGS="--Xdisable-tags --Xenable-git-content-hash-resolving-heuristic"
CMD="$FISHEYE_HOME/bin/fisheyectl.sh $1"
if [ $1 == "run" ]
then
CMD="nohup $CMD $ARGS >> $FISHEYE_HOME/var/log/nohup.out &";
fi
if [ "$USER" != "$RUN_AS" ]
then
su - "$RUN_AS" -c "$CMD";
else
sh -c "$CMD";
fi
}
case "$1" in
start)
fisheyectl run
;;
stop)
fisheyectl stop
;;
restart)
fisheyectl stop
sleep 10
fisheyectl run
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
我已经在本地通过 dos2unix 运行了这个。执行时:
fisheye: 23: fisheye: Syntax error: "}" unexpected (expecting "fi")
有什么建议么?