perl-modules: Added Monitoring-Plugin module
[omd.git] / packages / perl-modules / check_files
blob834e300290986f19df8103e53f111c4d81a640e7
1 #!/bin/bash
3 echo "checking for duplicate entries..."
4 sort Makefile | uniq -d | grep -v '^\s*$' | grep -v 'echo'
6 echo "checking src dir..."
7 for file in $(ls -1 src/ | sed 's/\-[0-9\-\.]*\.tar\.gz//g' | sort | uniq -d); do
8 echo "$file is listed twice in src/"
9 done
11 echo "checking for duplicate files..."
12 for file in $(grep 'tar.gz' Makefile | awk '{ print $1 }' | sed 's/\-[0-9\-\.]*\.tar\.gz//g' | sort | uniq -d); do
13 echo "$file is listed twice in Makefile"
14 done
16 echo "checking for unused files..."
17 for file in $(cd src && ls -1 *.gz *.tgz *.zip 2>/dev/null); do
18 if [ $(grep -c "$file" Makefile) = 0 ]; then
19 echo "$file is not used anymore"
21 done
23 echo "checking for missing files..."
24 for file in $(grep 'tar.gz' Makefile | awk '{ print $1 }'); do
25 if [ ! -e src/$file ]; then
26 echo "$file is missing but used in Makefile"
28 done