Created
August 1, 2023 16:16
-
-
Save Khahory/f597f9a65d925ba865a3412ede169f73 to your computer and use it in GitHub Desktop.
Buee, no funciona
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
num_inicio=$1 | |
num_fin=$2 | |
# for | |
for i in $(seq $num_inicio $num_fin); do | |
# validar si una ulr nos devuelve un 200 | |
url="https://idiomas.unapec.edu.do/media/$i/calendario-academico-2023-1.pdf" | |
response=$(curl -s -o /dev/null -w "%{http_code}" $url) | |
if [ $response -eq 200 ]; then | |
echo "La url $url esta activa" | |
mkdir -p ./descargas-linux | |
# descargar el archivo | |
curl -o ./descargas-linux/calendario-academico-2023-1-$i.pdf $url | |
else | |
echo "La url $url no esta activa" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment