From 96efb520e708f4b35aa52ad06400470562c2e2e3 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 29 May 2023 21:22:10 -0600 Subject: [PATCH] attempt to fix recursion #2 --- ishare2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ishare2 b/ishare2 index 41eb06b..a83f9f7 100755 --- a/ishare2 +++ b/ishare2 @@ -407,13 +407,17 @@ fetch_lists() { fi # Check if the file is empty or does not contain valid CSV content - if [ ! -s $ISHARE2_DIR"/$TYPE.csv" ] || ! validate_csv_file $ISHARE2_DIR"/$TYPE.csv"; then + if ! validate_csv_file $ISHARE2_DIR"/$TYPE.csv"; then echo -e "${RED} [!] The downloaded file is empty or does not contain valid CSV content.${NO_COLOR}" download_file_wget $URL $ISHARE2_DIR "$TYPE.csv" fi else echo -e "${YELLOW} [!] The list of images $TYPE does not exist. ${NO_COLOR}" download_file_wget $URL $ISHARE2_DIR "$TYPE.csv" + if ! validate_csv_file $ISHARE2_DIR"/$TYPE.csv"; then + echo -e "${RED} [!] The downloaded file is empty or does not contain valid CSV content.${NO_COLOR}" + download_file_wget $URL $ISHARE2_DIR "$TYPE.csv" + fi fi }