Last active
July 12, 2025 05:27
-
-
Save dewomser/e8fd35b249667f4912cb21de4753c188 to your computer and use it in GitHub Desktop.
Wurde diese Webseite verändert? Bashscript gibt Auskunft
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 | |
| #Dieses Script wurde von Bing-Chat erstellt | |
| #Prompt war vom @dewomser.Getestet von @dewomser | |
| # Get the last modification time of the file in seconds | |
| last_modified=$(stat -c "%Y" $file) | |
| # Read the previous value from ~/temp/letzter.txt | |
| previous_modified=$(cat ~/temp/letzter.txt) | |
| # Compare the last and previous values | |
| if [ $last_modified -gt $previous_modified ]; then | |
| echo "The file has changed" | |
| else | |
| echo "The file has not changed" | |
| fi | |
| # Write the last value to ~/temp/letzter.txt | |
| echo $last_modified > ~/temp/letzter.txt |
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 | |
| # Löok if there is an update for $test available today | |
| test=https://lua.rlp.de/fileadmin/lua/Downloads/Corona/Listen/Fallzahlen_und_Todesfaelle_Corona_RLP.xlsx | |
| codate1=$(curl -sI $test | grep -i 'Last-Modified:'|grep -E -o "[0-9]{2}[[:blank:]][[:alpha:]]{3}[[:blank:]][0-9]{4}") | |
| date1=$(LC_ALL=C date '+%d %b %Y' -u) | |
| #echo $codate1 $date1 | |
| if [[ "$date1" = "$codate1" ]] | |
| then | |
| echo "file is modified today" | |
| else | |
| echo "file is NOT modified today" | |
| # sleep 10 | |
| exit | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment