From b625e25655412c5dc6f61d10795eaa5759c2aadd Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 21 Mar 2024 15:33:17 +0800 Subject: [PATCH] lint: shellcheck script/server/init.sh Signed-off-by: wangqing --- script/server/init.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/script/server/init.sh b/script/server/init.sh index 31adb98b..73064926 100644 --- a/script/server/init.sh +++ b/script/server/init.sh @@ -1,20 +1,21 @@ #!/bin/bash -x +# shellcheck disable=SC2046 BaseDir=$(dirname $(readlink -f "$0")) FIRST_INIT_DONE=0 -cur_script_home=$(dirname $BaseDir) -pushd ${cur_script_home} +cur_script_home=$(dirname "$BaseDir") +pushd "${cur_script_home}" || exit 1 if [ $FIRST_INIT_DONE == 0 ]; then bash +x sysom.sh install ALL bash +x sysom.sh init ALL - local_app_home=$(dirname ${cur_script_home}) + local_app_home=$(dirname "${cur_script_home}") if [ "${local_app_home}" == "${APP_HOME}" ] || [ -z "$APP_HOME" ] || [ -z "$SCRIPT_HOME" ]; then - sed -i 's/^FIRST_INIT_DONE=0/FIRST_INIT_DONE=1/g' $0 + sed -i 's/^FIRST_INIT_DONE=0/FIRST_INIT_DONE=1/g' "$0" else - sed -i 's/^FIRST_INIT_DONE=0/FIRST_INIT_DONE=1/g' ${SCRIPT_HOME}/server/init.sh + sed -i 's/^FIRST_INIT_DONE=0/FIRST_INIT_DONE=1/g' "${SCRIPT_HOME}/server/init.sh" fi else bash +x sysom.sh start ALL fi -popd +popd || exit 1 -- Gitee