mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-03-14 12:46:15 +01:00
Add Bash script to verify image URLs
This commit is contained in:
parent
a235b97b48
commit
b58155e6ac
1 changed files with 17 additions and 0 deletions
17
check-ingsw-photos.sh
Executable file
17
check-ingsw-photos.sh
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SEARCHDIR="./Ingegneria del Software/"
|
||||||
|
|
||||||
|
echo "Invalid URLs:"
|
||||||
|
|
||||||
|
for img in `grep "img" "$SEARCHDIR" -R | sed -E 's/^(.*?)\.txt\:img\=//'`; do
|
||||||
|
img=$(echo "$img"|tr -d '\n'|tr -d '\r')
|
||||||
|
curl -I "$img" 2>/dev/null | \
|
||||||
|
grep -i "Content-Type: image/" >/dev/null
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
(
|
||||||
|
cd "$SEARCHDIR"
|
||||||
|
grep "$img" . -R
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in a new issue