dmacias72 / unRAID-NerdPack

GNU General Public License v2.0
77 stars 33 forks source link

Unraid version detection fails when minor version > 9 #52

Closed doron1 closed 3 years ago

doron1 commented 3 years ago

For Unraid versions with minor version >9 (case in point, 6.10.x), the plugin falls back to a single digit minor version (in the example, 6.1). This creates all sorts of issues. Culprit appears to be this line, in NerdPack.plg: VER=${version:0:3} which obviously picks up only the first digit of the minor version, and similarly, in NerdPackHelpers.php: $os_version = substr(parse_ini_file('/etc/unraid-version')['version'],0,3);

tjb-altf4 commented 3 years ago

This will fix the php issue $os_version = strtok(parse_ini_file('/etc/unraid-version')['version'], '.') . '.' . strtok('.');

doron1 commented 3 years ago

Sure, and for the bash issue (plg) it could be: VER=$(expr "$version" : "\([0-9]*\.[0-9]*\)")