Compare commits
1 Commits
9aea1cbf26
...
c46458bed4
Author | SHA1 | Date | |
---|---|---|---|
c46458bed4 |
@ -110,11 +110,9 @@ image_copy() {
|
|||||||
if [[ ! -e "$save_path" ]]; then
|
if [[ ! -e "$save_path" ]]; then
|
||||||
# If http, use curl to grab the image.
|
# If http, use curl to grab the image.
|
||||||
if [[ "$file" =~ ^http(s|)\:\/\/ ]]; then
|
if [[ "$file" =~ ^http(s|)\:\/\/ ]]; then
|
||||||
|
http_code=$(curl -s --write-out "%{http_code}" -o "$save_path" "$file")
|
||||||
# If failure, and is not the default image, attempt to grab the default file.
|
# If failure, and is not the default image, attempt to grab the default file.
|
||||||
if ! http_code=$(curl -s --write-out "%{http_code}" -o "$save_path" "$file") \
|
if [[ $? -ne 0 ]] || ((http_code!=200)) && [[ "$file" != "$icons_default_img" ]]; then
|
||||||
|| ( ((http_code!=200)) && [[ "$file" != "$icons_default_img" ]] \
|
|
||||||
&& [[ "$file" != "$icons_default_source/$icons_default_img" ]] ); then
|
|
||||||
image_copy "$icons_default_img" "$file_name"
|
image_copy "$icons_default_img" "$file_name"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user