#!/bin/bash

URL="https://yanglab.qd.sdu.edu.cn/Q-BioLiP/DATA/rec_cif_part"
FILES=(
    "rec_cif.part00"
    "rec_cif.part01"
    "rec_cif.part02"
    "rec_cif.part03"
    "rec_cif.part04"
    "rec_cif.part05"
    "rec_cif.part06"
    "rec_cif.part07"
)
 
DOWNLOAD_DIR="./downloads_rec_cif"
mkdir -p $DOWNLOAD_DIR

for FILENAME in "${FILES[@]}"; do
    wget -O "$DOWNLOAD_DIR/$FILENAME" "$URL/$FILENAME" --no-check-certificate
    
    
    echo "Downloaded $FILENAME from $URL"
done

echo "All files downloaded."

cat $DOWNLOAD_DIR/rec_cif.tar.gz.part* > $DOWNLOAD_DIR/rec_cif.tar.gz
rm $DOWNLOAD_DIR/rec_cif.tar.gz.part*

echo "All files merged."