14 lines
433 B
Bash
14 lines
433 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
for collection in */ ; do
|
||
|
for size in "$collection"*/ ; do
|
||
|
for image in "$size"* ; do
|
||
|
fileName=$(basename "$image")
|
||
|
imageName="${fileName%.*}"
|
||
|
hash=$(echo -n "$imageName" | sha1sum | awk '{print $1}')
|
||
|
mkdir -p $(dirname "$image")/${hash:2:2}/${hash:0:2}
|
||
|
ln -s $image $(dirname "$image")/${hash:2:2}/${hash:0:2}/$fileName
|
||
|
done
|
||
|
done
|
||
|
done
|