SHOW:
|
|
- or go back to the newest paste.
| 1 | #!/usr/bin/env bash | |
| 2 | ||
| 3 | set -o errexit | |
| 4 | set -o nounset | |
| 5 | set -o pipefail | |
| 6 | ||
| 7 | # .tld | |
| 8 | # META-INF/web-fragment.xml | |
| 9 | ||
| 10 | function main {
| |
| 11 | tomcat_home=$1 | |
| 12 | local jar_without_tld_list= | |
| 13 | ||
| 14 | for f in $(find ${tomcat_home} -name "*.jar"); do
| |
| 15 | printf "%-60s" "Checking $(basename $f): " | |
| 16 | if [[ $(unzip -v ${f} | grep -E '.tld$|web-fragment.xml$' | wc -l) -eq 0 ]]; then
| |
| 17 | printf "%-60s\n" "[Added]" | |
| 18 | jar_without_tld_list="${jar_without_tld_list}$(basename $f)\n"
| |
| 19 | else | |
| 20 | printf "%-60s\n" "[NOT Added]" | |
| 21 | fi | |
| 22 | done | |
| 23 | ||
| 24 | local result= | |
| 25 | for el in $(echo -e "$jar_without_tld_list" | sort -u); do | |
| 26 | if [ -n "${result}" ]; then
| |
| 27 | result="${result},${el}"
| |
| 28 | else | |
| 29 | result="${el},"
| |
| 30 | fi | |
| 31 | done | |
| 32 | ||
| 33 | echo "${result}"
| |
| 34 | } | |
| 35 | ||
| 36 | main "$@" |