Retrieving NAS4Free Build

For my NAS' e-mail report I wanted to display NAS4Free version. While uname does give quite a few options, none of them returned all the details I could see on the Status page. And this is where open source shines - source code to the rescue!

Quick investigation has shown that all necessary details are in There in get_product_name function I've found the first hint - set of prd.* files in /etc directory. Those files get built with the OS and have all the details needed.

To keep a long story short, this is what I've decided upon:

VERSION_TEXT="`cat /etc/` `$cat /etc/prd.version` `cat /etc/` (revision `cat /etc/prd.revision`)"

When ran on my current system, I get "NAS4Free - Prester (revision 2118)". Exactly what I needed. :)

Leave a Reply

Your email address will not be published. Required fields are marked *