forked from scossa/StreamingCommunity
fix se il link è guasto
This commit is contained in:
@@ -8,16 +8,13 @@ PWD_SC="$PWD"
|
|||||||
attuale="$(cat "$PWD_SC/attuale.txt")"
|
attuale="$(cat "$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+)?')
|
nuovo=$(curl --no-progress-meter -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streamingcommunity\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streamingcommunity\.\w+(\.\w+)?')
|
||||||
|
|
||||||
# Se il nuovo link è vuoto, ci sono casini in corso, lascia il vecchio link ed esce
|
# Se il nuovo link non è vuoto e diverso dal nuovo, allora aggiorna attuale.txt
|
||||||
if [ -z "$nuovo" ]; then
|
if [ "$attuale" != "$nuovo" ] && [ -n "$nuovo" ]; then
|
||||||
echo "STANNO FACENDO CASINI. LASCIATO IL VECCHIO LINK"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Altrimenti aggiorna il file "attuale.txt"
|
|
||||||
if [ "$attuale" != "$nuovo" ]; then
|
|
||||||
attuale="$nuovo"
|
attuale="$nuovo"
|
||||||
echo "$attuale" > $PWD_SC/attuale.txt
|
echo "$attuale" > $PWD_SC/attuale.txt
|
||||||
|
else
|
||||||
|
# ALTRIMENTI LASCIA IL VECCHIO
|
||||||
|
echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Formatta il link e lo stampa
|
# Formatta il link e lo stampa
|
||||||
|
|||||||
13
show_link.sh
13
show_link.sh
@@ -7,16 +7,13 @@ PWD_SC="$PWD"
|
|||||||
attuale="$(cat "$PWD_SC/attuale.txt")"
|
attuale="$(cat "$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+)?')
|
nuovo=$(curl --no-progress-meter -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streamingcommunity\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streamingcommunity\.\w+(\.\w+)?')
|
||||||
|
|
||||||
# Se il nuovo link è vuoto, ci sono casini in corso, lascia il vecchio link ed esce
|
# Se il nuovo link non è vuoto e diverso dal nuovo, allora aggiorna attuale.txt
|
||||||
if [ -z "$nuovo" ]; then
|
if [ "$attuale" != "$nuovo" ] && [ -n "$nuovo" ]; then
|
||||||
echo "STANNO FACENDO CASINI. LASCIATO IL VECCHIO LINK"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Altrimenti aggiorna il file "attuale.txt"
|
|
||||||
if [ "$attuale" != "$nuovo" ]; then
|
|
||||||
attuale="$nuovo"
|
attuale="$nuovo"
|
||||||
echo "$attuale" > $PWD_SC/attuale.txt
|
echo "$attuale" > $PWD_SC/attuale.txt
|
||||||
|
else
|
||||||
|
# ALTRIMENTI LASCIA IL VECCHIO
|
||||||
|
echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Formatta il link e lo stampa
|
# Formatta il link e lo stampa
|
||||||
|
|||||||
Reference in New Issue
Block a user