IT科技

大公司程序员带你死磕Tomcat—Tomcat如何做到一键式启停

时间:2010-12-5 17:23:32  作者:人工智能   来源:数据库  查看:  评论:0
内容摘要:复制os400=false case"`uname`"in OS400*)os400=true;; esac #

大公司程序员带你死磕Tomcat—Tomcat如何做到一键式启停
复制os400=false case"`uname`"in OS400*) os400=true;;  esac  # resolve links - $0 may be a softlink  # PRG是大公带死脚本路径,如果当前脚本文件为软连接,则会解析出PRG真正文件所在的路径  PRG="$0" while [ -h "$PRG" ] ; do # 判断是香港云服务器否为软连接   ls=`ls -ld "$PRG"` # 如果是软连接,输出中含有lin -> source的源码库字符串   link=`expr "$ls" : .*-> \(.*\)$` # 模式匹配出源文件的路径   if expr "$link" : /.* > /dev/null; then # 正则匹配 /.* 这里expr会输出匹配个数,如果不为0,则说明$link包含目录   PRG="$link"  else  PRG=`dirname "$PRG"`/"$link" # 当不包含目录,说明软连接和源文件在同一目录   fi  done  # 获取脚本目录路径  PRGDIR=`dirname "$PRG"`  EXECUTABLE=catalina.sh  # Check that target executable exists  if $os400; then  # -x will Onlyworkon the os400 if the files are:   # 1. owned by the user  # 2. owned by the PRIMARYgroupof the user  # this will notwork if the user belongs in secondary groups   eval  else  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then  echo "Cannot find $PRGDIR/$EXECUTABLE"  echo "The file is absent or does not have execute permission"  echo "This file is needed to run this program"  exit 1   fi  fi  # 执行catalina.sh的站群服务器start命令  exec"$PRGDIR"/"$EXECUTABLE" start "$@" 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.
copyright © 2025 powered by 益强资讯全景  滇ICP备2023006006号-31sitemap