43 lines
1.4 KiB
Bash
Executable File
43 lines
1.4 KiB
Bash
Executable File
#!/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 (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/*.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"
|
|
#chown www-data:www-data ./splash.gif; chmod 740 ./splash.gif; echo "do i permesi alla gif splash"
|