DietPi version information

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
svh1985
Posts: 5
Joined: Sat Oct 27, 2018 11:39 am

DietPi version information

Post by svh1985 »

Hi there,

Is there a command to output the installed version of DietPi?
And also; is there a similar command to check the latest one available?

I want to add this information to my Home Assistant overview like this:
Screenshot 2019-05-15 at 14.15.45.png
Thanks!
User avatar
MichaIng
Site Admin
Posts: 2419
Joined: Sat Nov 18, 2017 6:21 pm

Re: DietPi version information

Post by MichaIng »

@svh1985
/DietPi/dietpi/.version contains the installed version info. This is sourced to the login bash session, so you can run:
echo "$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC"

From within programs/scripts you either need to source the file as well or use grep/mawk/sed or something similar to scrape the version string.
svh1985
Posts: 5
Joined: Sat Oct 27, 2018 11:39 am

Re: DietPi version information

Post by svh1985 »

Perfect that works!
And what about getting the latest version that is available to download? I want to create a notification in Home Assistant to notify me when a new version of DietPi is available. 8)

Is this the place where DietPi checks the latest version available:
https://raw.githubusercontent.com/Micha ... _version-6

Thanks!!
User avatar
MichaIng
Site Admin
Posts: 2419
Joined: Sat Nov 18, 2017 6:21 pm

Re: DietPi version information

Post by MichaIng »

If the update check (dietpi-update 2, runs on boot and as daily cron job, if not disabled via dietpi.txt) will create the file /DietPi/dietpi/.update_available with exactly this version string inside, if an update is available.

And yep, the file you linked is the one that is checked for updates, when you are on master branch (default, stable).
Post Reply