This commit is contained in:
2025-01-26 18:59:58 +01:00
parent 64785ecba5
commit 78f4039061
3 changed files with 49 additions and 31 deletions

45
rss_generator.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
# SETTARE QUESTA VARIABILE CON IL PERCORSO GIUSTO:
# Es: PWD_SC="/var/www/html/streamingcommunity"
# O LASCIARE COSIì PER TESTARE IN LOCALE
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
# Setta permessi giusti standalone selfhosted (LEGGERE GLI NB)
# NB DECOMMENTARE QUESTI COMANDI SOLO SE USI rss_generator selfhosted MA NON makeindex.sh
# NB NELLA MAGGIORPARTE DEI CASI TI SERVIRA' SOLO IL COMANDO PER GLI XML
#chown -R root:root $PWD_SC; chmod 740 $PWD_SC/*; echo "reset a root dei permessi della cartella $PWD_SC e tutti i suoi file"
#chmod +x $PWD_SC ; echo "permetto a chiunque di attraversare $PWD_SC"
#chown root:root ./*.sh; chmod 740 ./*.sh; echo "do i permessi giusti agli sh dentro $PWD_SC"
# Setta permessi giusti versione selfhosted con make_index (versione tipica)
#chown -R www-data:www-data $PWD_SC/*.xml; chmod -R 744 $PWD_SC/*.xml; echo "do i permessi giusti agli xml dentro a $PWD_SC"