mrworf / plexupdate

Plex Update script to simplify the life of Linux Plex Media Server users.
GNU General Public License v2.0
1.77k stars 146 forks source link

Run script iff installer finishes update #262

Closed tijmenvn closed 5 years ago

tijmenvn commented 5 years ago

Is there a feature where I can call a script to run if the installer finishes download and installer? There is a script I need to run after every update, else hardware decode won't work and I'd like to automate this to run ONLY when the installer updates. Might be already in plexupdate, haven't found it myself though.

demonbane commented 5 years ago

The best way to do this would be to just use a script to run plexupdate, and then do anything necessary afterwards. plexupdate will return exit code 10 if a new version was downloaded/installed, so you can just do something like

plexupdate.sh <your options here>
if [ $? -eq 10 ]; then
    your_update_code
fi

If you're running plexupdate as a scheduled task, you can also just make a copy of extras/cronwrapper with your changes added and replace the symlinked copy in /etc/cron.daily. (This is assuming you used the installer.)

tijmenvn commented 5 years ago

The best way to do this would be to just use a script to run plexupdate, and then do anything necessary afterwards. plexupdate will return exit code 10 if a new version was downloaded/installed, so you can just do something like

plexupdate.sh <your options here>
if [ $? -eq 10 ]; then
    your_update_code
fi

If you're running plexupdate as a scheduled task, you can also just make a copy of extras/cronwrapper with your changes added and replace the symlinked copy in /etc/cron.daily. (This is assuming you used the installer.)

Thanks! I was looking for what code to use when plexupdate had downloaded/installed new version. This should indeed be relatively easy to updat