diff --git a/script/server/init.sh b/script/server/init.sh index 31adb98b4a5f569af5e1146f804dc90ae53bf369..7306492656f7f6521d00cd11832d438196d46955 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