]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/mklslar
Local security-master changes
[dak.git] / scripts / debian / mklslar
1 #!/bin/sh
2 # Update the ls-lR.
3
4 set -e
5 . $SCRIPTVARS
6
7 cd $ftpdir
8
9 filename=ls-lR
10
11 echo "Removing any core files ..."
12 find -type f -name core -print0 | xargs -0r rm -v
13
14 echo "Checking permissions on files in the FTP tree ..."
15 find -type f \( \! -perm -444 -o -perm +002 \) -ls
16 find -type d \( \! -perm -555 -o -perm +002 \) -ls
17
18 echo "Checking symlinks ..."
19 symlinks -rd .
20
21 echo "Creating recursive directory listing ... "
22 rm -f .$filename.new
23 TZ=UTC ls -lR | grep -v Archive_Maintenance_In_Progress > .$filename.new
24
25 if [ -r ${filename}.gz ] ; then
26   mv -f ${filename}.gz $filename.old.gz
27   mv -f .$filename.new $filename
28   rm -f $filename.patch.gz
29   zcat $filename.old.gz | diff -u - $filename | gzip -9cfn - >$filename.patch.gz
30   rm -f $filename.old.gz
31 else
32   mv -f .$filename.new $filename
33 fi
34
35 gzip -9cfN $filename >$filename.gz
36 rm -f $filename