#!/bin/bash

export scanDate=`date +%Y%m%d`

#export searchfilelist=`find . -type f -name '*JEUSMain.xml'`;
export searchfilelist=`find . -type f -name 'assessment_*.log'`;


for entry in $searchfilelist
do
  echo "#####################"
  echo "# fileName = $entry #"
  echo "#####################"

  filename=$entry

# JEUS6 기준
  export jeus6_grep="version=|<node>|<name>|<engine-container>|<base-port>|<command-option>|<resource>|<vendor>|<export-name>|<data-source-class-name>|<database-name>|<value>|<port-number>|<server-name>|<user>|<password>|<min>|<max>|<application>|<path>|<web-component>|<context-root>|<deployment-target>|<engine-container-name>"

# JEUS7 기준
  export jeus7_grep="version=|<admin-server-name>|<domain-log-home>|<session-cluster-config>|<session-clusters>|<session-cluster>|<name>|<jeus-login-manager>|<primary>|<secondary>|<common-cluster-config>|<servers>|<server>|<node-name>|<listen-address>|<listen-port>|<jvm-config>|<jvm-option>|<system-thread-pool>|<web-connections>|<webtob-connector>|<network-address>|<ip-address>|<port>|<data-sources>|<data-source>|<clusters>|<cluster>|<servers>|<server-name>|<session-router-config>|<deployed-applications>|<deployed-application>|<context-path>|<id>|<path>|<type>|<targets>|<server>|<name>|<resources>|<resource>|<data-source>|<database>|<data-source-id>|<export-name>|<data-source-class-name>|<database-name>"

# WebToB 기준
  export webtob_grep="WEBTOBDIR|VHOST|DOCROOT|NODENAME|HOSTNAME|PORT|URLREWRITE|URLREWRITECONFIG|SSLFLAG|SSLNAME|LOGGING|ERRORLOG|SYSLOG|JSVPORT|SVRGROUP|SVRTYPE|SERVER|SVGNAME|URI|Uri|Redirect|ACCESS|Order|ALIAS|RealPath|LOGGING|Format|Option|Mimetype"

  egrep "$jeus6_grep|$jeus7_grep|$webtob_grep" $filename > jeus_domains/$filename.$scanDate

done;
