Compare commits

..

1 Commits

Author SHA1 Message Date
9aea1cbf26 Add mirror-file-generator tool 2024-02-17 10:44:32 -06:00

View File

@ -110,9 +110,11 @@ 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 [[ $? -ne 0 ]] || ((http_code!=200)) && [[ "$file" != "$icons_default_img" ]]; then 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
image_copy "$icons_default_img" "$file_name" image_copy "$icons_default_img" "$file_name"
return return
fi fi