diff --git a/make_index.sh b/make_index.sh index 2ea40c9..a22e202 100755 --- a/make_index.sh +++ b/make_index.sh @@ -8,15 +8,22 @@ PWD_SC="$PWD" 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+)?') -# Se il nuovo link non è vuoto e diverso dal nuovo, allora aggiorna attuale.txt -if [ "$attuale" != "$nuovo" ] && [ -n "$nuovo" ]; then +# Se il nuovo link è diverso dal nuovo, allora... +if [ "$attuale" != "$nuovo" ]; then + # se è vuoto lascia il vecchio + if [ -z "$nuovo" ]; then + echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK" + else + # Se non è vuoto lo aggiorna con il nuovo link il file attuale.txt attuale="$nuovo" echo "$attuale" > $PWD_SC/attuale.txt - else - # ALTRIMENTI LASCIA IL VECCHIO - echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK" + fi +else + # se il link giusto è ancora il vecchio lascia il vecchio + echo "Il link giusto è ancora il vecchio" fi + # Formatta il link e lo stampa formatted="https://$(cat "$PWD_SC/attuale.txt")" echo "$formatted" diff --git a/show_link.sh b/show_link.sh index 4d5797e..d8686cf 100755 --- a/show_link.sh +++ b/show_link.sh @@ -7,15 +7,23 @@ PWD_SC="$PWD" 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+)?') -# Se il nuovo link non è vuoto e diverso dal nuovo, allora aggiorna attuale.txt -if [ "$attuale" != "$nuovo" ] && [ -n "$nuovo" ]; then +# Se il nuovo link è diverso dal nuovo, allora... +if [ "$attuale" != "$nuovo" ]; then + # se è vuoto lascia il vecchio + if [ -z "$nuovo" ]; then + echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK" + else + # Se non è vuoto lo aggiorna con il nuovo link il file attuale.txt attuale="$nuovo" echo "$attuale" > $PWD_SC/attuale.txt - else - # ALTRIMENTI LASCIA IL VECCHIO - echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK" + fi +else + # se il link giusto è ancora il vecchio lascia il vecchio + echo "Il link giusto è ancora il vecchio" fi + + # Formatta il link e lo stampa attuale="https://$(cat "$PWD_SC/attuale.txt")" echo -e "\nLink aggiornato:\n$attuale\n" \ No newline at end of file diff --git a/stats.txt b/stats.txt new file mode 100644 index 0000000..f320c96 --- /dev/null +++ b/stats.txt @@ -0,0 +1,5 @@ +#Cose: +http://ec2-52-203-236-205.compute-1.amazonaws.com:8080/ +http://ec2-52-203-236-205.compute-1.amazonaws.com:8081/ +http://52.203.236.205:8080/ +http://52.203.236.205:8081/: \ No newline at end of file