Created
December 7, 2024 08:15
-
-
Save dewomser/c7f5d9f9180b7e30fed0189da2864733 to your computer and use it in GitHub Desktop.
Tägliche Abfrage ob es schon eine frische Datei auf dem Webserver gibt. #Bash
This file contains 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 | |
# Tagesvergleich für $test.Wenn Tag von date ist Tag von codate dann "Heute neue Datei" | |
# evtl muss das Script auf die Antwort des Webservers angepasstwerden. | |
test=https://url/lolo.xyz | |
codate=$(curl -sI $test | grep -i '^Last-Modified'|sed 's/Last-Modified: //g') | |
codate1=$(date -d "$codate" +%d) | |
date1=$(date +%d) | |
if [ $date1 -eq $codate1 ] | |
then | |
echo "heute neue Datei" | |
else | |
echo "heute nicht neu" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment