up
This commit is contained in:
@@ -1,17 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
attuale=$(<attuale.txt)
|
attuale=$(</var/www/html/scommunity/attuale.txt)
|
||||||
|
|
||||||
nuovo=$(curl -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streamingcommunity\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streamingcommunity\.\w+(\.\w+)?')
|
nuovo=$(curl -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streamingcommunity\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streamingcommunity\.\w+(\.\w+)?')
|
||||||
|
|
||||||
if [ "$attuale" != "$nuovo" ]; then
|
if [ "$attuale" != "$nuovo" ]; then
|
||||||
attuale="$nuovo"
|
attuale="$nuovo"
|
||||||
echo "$attuale" > attuale.txt
|
echo "$attuale" > /var/www/html/scommunity/attuale.txt
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
formatted="https://$(<//var/www/html/scommunity/attuale.txt)"
|
||||||
formatted="https://$(<attuale.txt)"
|
echo "$formatted"
|
||||||
|
|
||||||
cat <<- _EOF > /var/www/html/scommunity/index.html
|
cat <<- _EOF > /var/www/html/scommunity/index.html
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@@ -87,7 +86,7 @@ cat <<- _EOF > /var/www/html/scommunity/index.html
|
|||||||
|
|
||||||
<div class="link">
|
<div class="link">
|
||||||
<h3>Link aggiornato per Streaming Community:</h3>
|
<h3>Link aggiornato per Streaming Community:</h3>
|
||||||
<h1><a href=$formatted>$formatted</a></h1>
|
<h1> <a href=$formatted> $formatted </a> </h1>
|
||||||
<h3>(cambia circa una volta al mese)</h3>
|
<h3>(cambia circa una volta al mese)</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -100,5 +99,3 @@ cat <<- _EOF > /var/www/html/scommunity/index.html
|
|||||||
_EOF
|
_EOF
|
||||||
|
|
||||||
sudo chown -R www-data:www-data /var/www/html/scommunity ; sudo chmod -R 755 /var/www/html/scommunity
|
sudo chown -R www-data:www-data /var/www/html/scommunity ; sudo chmod -R 755 /var/www/html/scommunity
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user