-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrupal_find_new_files.sh
49 lines (40 loc) · 1.25 KB
/
drupal_find_new_files.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
echo "" > report.log
find ./ -maxdepth 1 -name "*\.tar\.gz" -print | cut -c 3- | while read i
do
# echo "TAR NAME = $i"
name=$( tar xvfz $i | cut -d "/" -f 1 | tail -n 1 )
# echo "NAME DIR = $name"
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" >> report.log
echo "<<< $name >>>" >> report.log
#check drupal core
if [ -z $( echo $name | grep "^drupal-[67]\.[0123456789]" ) ] then
#check module exists
if [ -z "$(find $1/ -maxdepth 1 -name "$name" -print)" ] then
#check theme
if [ $name==$( basename $3 ) ] then
echo "This is theme!" >> report.log
diff -rq $name $3 | grep "Only in $3" >> report.log
else
echo "NOT FOUND" >> report.log
fi
else
#check for changes
if [ -z "$(diff -rq $name $1/$name | grep "Only in $1")" ] then
echo "OK" >> report.log
else
diff -rq $name $1/$name | grep "Only in $1" >> report.log
fi
fi
else
#check core folders
find $name/ -maxdepth 1 -type d -print | cut -d "/" -f 2 | while read j
do
if [ $j != "sites" ] then
echo "|||||||| $j ||||||||" >> report.log
diff -rq $name/$j $2/$j | grep "Only in $2" >> report.log
fi
done
fi
rm -r $name
done