Compare commits

..

1 Commits

Author SHA1 Message Date
c46458bed4 Add mirror-file-generator tool 2024-02-17 01:00:58 -06:00

View File

@ -110,11 +110,9 @@ image_copy() {
if [[ ! -e "$save_path" ]]; then
# If http, use curl to grab the image.
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 ! http_code=$(curl -s --write-out "%{http_code}" -o "$save_path" "$file") \
|| ( ((http_code!=200)) && [[ "$file" != "$icons_default_img" ]] \
&& [[ "$file" != "$icons_default_source/$icons_default_img" ]] ); then
if [[ $? -ne 0 ]] || ((http_code!=200)) && [[ "$file" != "$icons_default_img" ]]; then
image_copy "$icons_default_img" "$file_name"
return
fi