« Plex : télécharger les mises à jour automatiquement » : différence entre les versions
Aller à la navigation
Aller à la recherche
(Page créée avec « <pre> #! /bin/bash target="https://plex.tv/downloads" w3m -dump $target 2>/dev/null > /root/plexupdate/tmp/plex_downloads.html latest_version=`grep -C 3 "Ubuntu" /root/p... ») |
Aucun résumé des modifications |
||
Ligne 3 : | Ligne 3 : | ||
target="https://plex.tv/downloads" | target="https://plex.tv/downloads" | ||
if [ "$1" == "cron" ]; then | |||
cron=1 | |||
else | |||
cron=0 | |||
fi | |||
w3m -dump $target 2>/dev/null > /root/plexupdate/tmp/plex_downloads.html | w3m -dump $target 2>/dev/null > /root/plexupdate/tmp/plex_downloads.html | ||
latest_version=`grep -C 3 "Ubuntu" /root/plexupdate/tmp/plex_downloads.html | grep Version | cut -d" " -f6` | latest_version=`grep -C 3 "Ubuntu" /root/plexupdate/tmp/plex_downloads.html | grep Version | cut -d" " -f6` | ||
echo "Latest version is $latest_version" | if [ $cron = 0 ]; then echo "Latest version is $latest_version"; fi | ||
current_version=`dpkg -s plexmediaserver | grep Version: | cut -d" " -f2` | current_version=`dpkg -s plexmediaserver | grep Version: | cut -d" " -f2` | ||
echo "Current version is $current_version" | if [ $cron = 0 ]; then echo "Current version is $current_version"; fi | ||
current_version="plop" | |||
if [ ! "$latest_version" == "$current_version" ]; then | if [ ! "$latest_version" == "$current_version" ]; then | ||
echo "downloading new plex version $latest_version | echo "A new plex version is available" | ||
if [ ! -f /root/plexupdate/plexmediaserver_"$latest_version"_amd64.deb ]; then | |||
echo "downloading new plex version $latest_version" | |||
wget -q -O plexmediaserver_"$latest_version"_amd64.deb https://downloads.plex.tv/plex-media-server/"$latest_version"/plexmediaserver_"$latest_version"_amd64.deb | |||
fi | |||
echo "install it using dpkg -i plexmediaserver_"$latest_version"_amd64.deb" | |||
fi | fi | ||
</pre> | </pre> |
Version du 7 novembre 2015 à 14:19
#! /bin/bash target="https://plex.tv/downloads" if [ "$1" == "cron" ]; then cron=1 else cron=0 fi w3m -dump $target 2>/dev/null > /root/plexupdate/tmp/plex_downloads.html latest_version=`grep -C 3 "Ubuntu" /root/plexupdate/tmp/plex_downloads.html | grep Version | cut -d" " -f6` if [ $cron = 0 ]; then echo "Latest version is $latest_version"; fi current_version=`dpkg -s plexmediaserver | grep Version: | cut -d" " -f2` if [ $cron = 0 ]; then echo "Current version is $current_version"; fi current_version="plop" if [ ! "$latest_version" == "$current_version" ]; then echo "A new plex version is available" if [ ! -f /root/plexupdate/plexmediaserver_"$latest_version"_amd64.deb ]; then echo "downloading new plex version $latest_version" wget -q -O plexmediaserver_"$latest_version"_amd64.deb https://downloads.plex.tv/plex-media-server/"$latest_version"/plexmediaserver_"$latest_version"_amd64.deb fi echo "install it using dpkg -i plexmediaserver_"$latest_version"_amd64.deb" fi