Small cleanup in DLEP code to make sure session cleanup does not block
[oonf.git] / files / check_licences.sh
1 #!/bin/sh
2
3 LEN=`cat ./files/default_licence.txt |wc -c`
4
5 OKAY=0
6 BAD=0
7
8 EXCEPT="-not -wholename ./src-plugins/generic/nl80211_listener/nl80211.h"
9 EXCEPT="${EXCEPT} -not -wholename ./src-plugins/generic/eth_listener/ethtool-copy.h"
10 for file in $(eval find ./src* ./tests ./examples -type f -name *[.][ch] ${EXCEPT})
11 do
12         cmp --bytes ${LEN} ${file} ./files/default_licence.txt
13         if [ ${?} != 0 ]
14         then
15                 BAD=$((${BAD} + 1))
16         else
17                 OKAY=$((${OKAY} + 1))
18         fi
19 done
20
21 TOTAL=$((${OKAY} + ${BAD}))
22
23 if [ ${OKAY} != 0 ]
24 then
25         echo "Found ${OKAY} source/header files with the correct header"
26 fi
27 if [ ${BAD} != 0 ]
28 then
29         echo "Found ${BAD} source/header files with the wrong or an outdated header"
30 fi
31 if [ ${TOTAL} = 0 ]
32 then
33         echo "No files found, please run script from the main directory of the repository"
34 fi