```bash
# 比较当前时间和开启时间,如果相等,则启动tomcat
if [ "$CURRENT_TIME" == "$START_TIME" ]; then
echo "Starting tomcat at $CURRENT_TIME" >> $LOG_FILE
$TOMCAT_HOME/bin/startup.sh >> $LOG_FILE 2>&1
fi
# 比较当前时间和关闭时间,如果相等,则停止tomcat
if [ "$CURRENT_TIME" == "$STOP_TIME" ]; then
echo "Stopping tomcat at $CURRENT_TIME" >> $LOG_FILE
$TOMCAT_HOME/bin/shutdown.sh >> $LOG_FILE 2>&1
fi
# 退出脚本
exit 0
```
# 比较当前时间和开启时间,如果相等,则启动tomcat
if [ "$CURRENT_TIME" == "$START_TIME" ]; then
echo "Starting tomcat at $CURRENT_TIME" >> $LOG_FILE
$TOMCAT_HOME/bin/startup.sh >> $LOG_FILE 2>&1
fi
# 比较当前时间和关闭时间,如果相等,则停止tomcat
if [ "$CURRENT_TIME" == "$STOP_TIME" ]; then
echo "Stopping tomcat at $CURRENT_TIME" >> $LOG_FILE
$TOMCAT_HOME/bin/shutdown.sh >> $LOG_FILE 2>&1
fi
# 退出脚本
exit 0
```