0

以下は、Atlassian からダウンロードした簡単なシェル スクリプトで、これまでに見つかったすべての提案に合わせてわずかに調整されています。

#!/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")

助言がありますか?

4

3 に答える 3