You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
534 B
23 lines
534 B
15 years ago
|
#!/bin/bash
|
||
|
|
||
|
COVERNAMES="cover.jpg cover.png front.jpg front.png"
|
||
|
|
||
|
for COVERNAME in $COVERNAMES; do
|
||
|
|
||
|
S_FILENAME=`echo "$1" | sed "s/^.*\///"`
|
||
|
S_DIRECTORY=`echo "$1" | sed "s/$S_FILENAME//"`
|
||
|
SOURCE=`ls "$S_DIRECTORY" | grep -F $COVERNAME`
|
||
|
|
||
|
D_FILENAME=`echo "$2" | sed "s/^.*\///"`
|
||
|
D_DIRECTORY=`echo "$2" | sed "s/$D_FILENAME//"`
|
||
|
DESTINATION="$COVERNAME"
|
||
|
|
||
|
if [ $SOURCE ]; then
|
||
|
# echo "cp $S_DIRECTORY$SOURCE $D_DIRECTORY$DESTINATION"
|
||
|
cp --update "$S_DIRECTORY$SOURCE" "$D_DIRECTORY$DESTINATION"
|
||
|
fi
|
||
|
|
||
|
done
|
||
|
|
||
|
exit 0
|