Files
StreamingCommunity/rss_gerator.sh
2025-01-25 19:55:40 +01:00

41 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# SETTARE QUESTA VARIABILE CON IL PERCORSO GIUSTO:
# Es: PWD_SC="/var/www/html/streamingcommunity"
PWD_SC="$PWD"
# Formatta il link e lo stampa
formatted="https://$(cat "$PWD_SC/attuale.txt")"
echo "$formatted"
data=$(date +%Y-%m-%d)
# Crea pagina "rss.xml"
cat <<- _EOF > $PWD_SC/rss.xml
<rss version="2.0">
<channel>
<title>Fanculo Netflix</title>
<link>$formatted</link>
<description>Link sempre aggiornato</description>
<lastBuildDate>$data</lastBuildDate>
<language>it-IT</language>
<item>
<title>$formatted</title>
<link>$formatted</link>
<pubDate>$date</pubDate>
<guid isPermaLink="false">$formatted</guid>
</item>
</channel>
</rss>
_EOF
# Da i permessi alla cartella (decommentare se hostato)
#chown -R root:root $PWD_SC; echo "la cartella $PWD_SC รจ di root"
#chmod +x $PWD_SC ; echo "permetto di leggere dentro a $PWD_SC"
#chmod 740 $PWD_SC/*; echo "reset permessi per tutti i file dentro a $PWD_SC"
#chown -R www-data:www-data $PWD_SC/*.html; chmod -R 744 $PWD_SC/*.html; echo "do i permessi agli html dentro a $PWD_SC"
#chown -R www-data:www-data $PWD_SC/*.json; chmod -R 744 $PWD_SC/*.json; echo "do i permessi ai json dentro a $PWD_SC"
#chown -R www-data:www-data $PWD_SC/*.xml; chmod -R 744 $PWD_SC/*.xml; echo "do i permessi agli xml dentro a $PWD_SC"
#chown root:root ./*.sh; chmod 740 ./*.sh; echo "do i permesi agli sh dentro $PWD_SC"