#!/usr/bin/env bash## Licensed to the Apache Software Foundation (ASF) under one or more# contributor license agreements. See the NOTICE file distributed with# this work for additional information regarding copyright ownership.# The ASF licenses this file to You under the Apache License, Version 2.0# (the "License"); you may not use this file except in compliance with# the License. You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.## source mefunction isValidJavaVersion() {version=$(${JAVA} -version 2>&1 | awk -F\" '/version/ {print 2ドル}')version_first_part="$(echo ${version} | cut -d '.' -f1)"version_second_part="$(echo ${version} | cut -d '.' -f2)"if [[ "$version_first_part" -eq "1" ]] && [[ "$version_second_part" -eq "8" ]]; then# jdk version: 1.8.0-332echo "true"exit 0elif [[ "$version_first_part" -ge "8" ]]; then# jdk version: 11.0.15 / 17.0.3echo "true"exit 0elseecho "false"exit 0fi}# avoid re-enteringif [[ "$dir" == "" ]]thendir=$(cd -P -- "$(dirname -- "0ドル")" && pwd -P)# misc functionsfunction quit {echo "$@"if [[ -n "${QUIT_MESSAGE_LOG}" ]]; thenecho $(setColor 31 "$@") >> ${QUIT_MESSAGE_LOG}fiexit 1}function verbose {if [[ -n "$verbose" ]]; thenecho "$@"fi}function setColor() {echo -e "0円33[1ドルm2ドル0円33[0m"}function getValueByKey() {while read linedo key=${line%=*} val=${line#*=}if [ "${key}" == "1ドル" ]; thenecho $valbreakfidone<2ドル}# setup verboseverbose=${verbose:-""}while getopts ":v" opt; docase $opt inv)echo "Turn on verbose mode." >&2export verbose=true;;\?)echo "Invalid option: -$OPTARG" >&2;;esacdone# check MachineunameOut="$(uname -s)"case "${unameOut}" inLinux*) os=Linux;;Darwin*) os=Mac;;CYGWIN*) os=Cygwin;;MINGW*) os=MinGw;;*) os="UNKNOWN:${unameOut}"esacexport MACHINE_OS=$os# set BYZER_HOMEif [ -z $BYZER_HOME ];thenexport BYZER_HOME=$(cd -P -- "$(dirname -- "0ドル")"/../ && pwd -P)fi# set JAVAif [[ "${JAVA}" == "" ]]; thenif [[ -z "$JAVA_HOME" ]]; then# if $JAVA_HOME is not foundif [[ $MACHINE_OS == "Mac" ]]; thenif command -v java &> /dev/null ; then# try to use jdk in systemJAVA_HOME=$(dirname $(dirname $(readlink $(which java))))elif [[ -d "${BYZER_HOME}/jdk8/Contents/Home/" ]]; then# No Java found, try to use embedded open jdk (only works on byzer-all-in-one)JAVA_HOME=${BYZER_HOME}/jdk8/Contents/Homeelsequit "Java environment not found, Java 1.8 or above is required."fielif [[ $MACHINE_OS == "Linux" ]]; thenif command -v java &> /dev/null ; then# try to use jdk in systemJAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))elif [[ -d "${BYZER_HOME}/jdk8/" ]]; then# No Java found, try to use embedded open jdk (only works on byzer-all-in-one)JAVA_HOME="${BYZER_HOME}"/jdk8elsequit "Java environment not found, Java 1.8 or above is required."fielsequit "Not suppported operating system: $MACHINE_OS"fi[[ -z "$JAVA_HOME" ]] && quit "JAVA_HOME is not found, please set JAVA_HOME"export JAVA_HOMEfi# check java command is foundexport JAVA=$JAVA_HOME/bin/java[[ -e "${JAVA}" ]] || quit "${JAVA} does not exist. Please set JAVA_HOME correctly."verbose "java is ${JAVA}"fi# set BYZER_IPif [ -z $BYZER_IP ];thenexport BYZER_IP=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -n 1)fi# set BYZER_PORTexport BYZER_LANG_PORT=$($BYZER_HOME/bin/get-properties.sh streaming.driver.port)if [[ -z ${BYZER_LANG_PORT} ]]; thenexport BYZER_LANG_PORT=9003fi# set ServerModeexport BYZER_SERVER_MODE=$($BYZER_HOME/bin/get-properties.sh byzer.server.mode)if [[ -z ${BYZER_SERVER_MODE} ]]; thenexport BYZER_SERVER_MODE="server"fifi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。