#!/bin/bash # SETTARE QUESTA VARIABILE CON IL PERCORSO GIUSTO: # Es: PWD_SC="/var/www/html/streamingcommunity" PWD_SC="$PWD" # Se il link รจ cambiato, allora aggiorna il file "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+)?') if [ "$attuale" != "$nuovo" ]; then attuale="$nuovo" echo "$attuale" > $PWD_SC/attuale.txt fi # Formatta il link e lo stampa formatted="https://$(cat "$PWD_SC/attuale.txt")" echo "$formatted" # Crea pagina "index.html" cat <<- _EOF > $PWD_SC/index.html