diff --git a/novel-admin/src/main/build/scripts/novel-admin.sh b/novel-admin/src/main/build/scripts/novel-admin.sh index 354f43f..2956619 100644 --- a/novel-admin/src/main/build/scripts/novel-admin.sh +++ b/novel-admin/src/main/build/scripts/novel-admin.sh @@ -5,9 +5,12 @@ JAR_NAME=$APP_NAME\.jar PID=$APP_NAME\.pid -#使用说明,用来提示输入参数 +SCRIPT_DIR=$(dirname "$(readlink -f "$0")") +cd "$SCRIPT_DIR"/.. || exit 1 + +# 使用说明 usage() { - echo "Usage: ./novel-admin.sh [start|stop|restart|status]" + echo "Usage: $0 [start|stop|restart|status]" exit 1 } diff --git a/novel-crawl/src/main/build/scripts/novel-crawl.sh b/novel-crawl/src/main/build/scripts/novel-crawl.sh index 1e7f148..a958ac4 100644 --- a/novel-crawl/src/main/build/scripts/novel-crawl.sh +++ b/novel-crawl/src/main/build/scripts/novel-crawl.sh @@ -5,9 +5,12 @@ JAR_NAME=$APP_NAME\.jar PID=$APP_NAME\.pid -#使用说明,用来提示输入参数 +SCRIPT_DIR=$(dirname "$(readlink -f "$0")") +cd "$SCRIPT_DIR"/.. || exit 1 + +# 使用说明 usage() { - echo "Usage: ./novel-crawl.sh [start|stop|restart|status]" + echo "Usage: $0 [start|stop|restart|status]" exit 1 } diff --git a/novel-front/src/main/build/scripts/novel-front.sh b/novel-front/src/main/build/scripts/novel-front.sh index c663072..f4eb4c7 100644 --- a/novel-front/src/main/build/scripts/novel-front.sh +++ b/novel-front/src/main/build/scripts/novel-front.sh @@ -4,10 +4,12 @@ JAR_NAME=$APP_NAME\.jar #PID 代表是PID文件 PID=$APP_NAME\.pid +SCRIPT_DIR=$(dirname "$(readlink -f "$0")") +cd "$SCRIPT_DIR"/.. || exit 1 -#使用说明,用来提示输入参数 +# 使用说明 usage() { - echo "Usage: ./novel-front.sh [start|stop|restart|status]" + echo "Usage: $0 [start|stop|restart|status]" exit 1 }