forked from hummypkg/webif
d0d6474169
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif@173 2a923420-c742-0410-a762-8d5b09965624
24 lines
509 B
Bash
24 lines
509 B
Bash
#!/bin/sh
|
|
|
|
#[ ! -f checksums ] && for f in *.png; do
|
|
# [ -h "$f" ] && continue
|
|
# [ -f "$f" ] || continue
|
|
# sha1sum "$f"
|
|
#done > checksums
|
|
|
|
cat checksums | while read line; do
|
|
sum=`echo $line | awk '{print $1}'`
|
|
file="`echo $line | cut -d\ -f2-`"
|
|
[ -h "$file" ] && continue
|
|
set -f
|
|
echo "$file..."
|
|
grep "^$sum" checksums | while read dup; do
|
|
file2="`echo $dup | cut -d\ -f2-`"
|
|
[ "$file" = "$file2" ] && continue
|
|
echo "$file -> $file2"
|
|
rm -f "$file2"
|
|
ln -s "$file" "$file2"
|
|
done
|
|
set +f
|
|
done
|