Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -o errexit
- set -o nounset
- set -o pipefail
- # .tld
- # META-INF/web-fragment.xml
- function main {
- tomcat_home=$1
- local jar_without_tld_list=
- for f in $(find ${tomcat_home} -name "*.jar"); do
- printf "%-60s" "Checking $(basename $f): "
- if [[ $(unzip -v ${f} | grep -E '.tld$|web-fragment.xml$' | wc -l) -eq 0 ]]; then
- printf "%-60s\n" "[Added]"
- jar_without_tld_list="${jar_without_tld_list}$(basename $f)\n"
- else
- printf "%-60s\n" "[NOT Added]"
- fi
- done
- local result=
- for el in $(echo -e "$jar_without_tld_list" | sort -u); do
- if [ -n "${result}" ]; then
- result="${result},${el}"
- else
- result="${el},"
- fi
- done
- echo "${result}"
- }
- main "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement