1. Tomcat之startup.sh

#判断操作系统
os400=false
case "`uname`" in
OS400*) os400=true;;
esac

# 取脚本名称
PRG="$0"

# 判断是否是软连接
while [ -h "$PRG" ] ; do
  # 查看脚本信息
  ls=`ls -ld "$PRG"`
  # 获取真实脚本路径
  link=`expr "$ls" : '.*-> \(.*\)$'`
  # 是否是绝对路径
  if expr "$link" : '/.*' > /dev/null; then
    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 Only work on the os400 if the files are:
  # 1. owned by the user
  # 2. owned by the PRIMARY group of the user
  # this will not work 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 "$@"
发布了44 篇原创文章 · 获赞 13 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_19457117/article/details/82533391