This commit is contained in:
2025-01-13 18:58:51 +01:00
parent 59e135063a
commit e030c20ce6
3 changed files with 5 additions and 5 deletions

16
show_link.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
# SETTARE QUESTA VARIABILE SE LO SCRIPT NON VIENE USATO IN LOCALE:
PWD_SC="$PWD"
# Se il link è stato aggiornato, aggiorna il file "attuale.txt"
attuale=$(<$PWD_SC/attuale.txt)
nuovo=$(curl --no-progress-meter -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streamingcommunity\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streamingcommunity\.\w+(\.\w+)?')
if [ "$attuale" != "$nuovo" ]; then
attuale="$nuovo"
echo "$attuale" > $PWD_SC/attuale.txt
fi
# Formatta il link e lo stampa
attuale="https://$(cat "$PWD_SC/attuale.txt")"
echo -e "\nLink aggiornato:\n$attuale\n"