Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checking Unraid version

Featured Replies

To save me writing my own I was wondering if there is a standard PHP routine in Unraid that I can use to check that the Unraid version meets the requirements for a new feature I am adding to a plugin (needs to be Unraid 6.9.0 beta 36 or higher). Ideally this routine would handle both stable and next type releases. 

 

It feels like a routine that may already be present somewhere if I could just locate it :)

21 minutes ago, itimpi said:

To save me writing my own I was wondering if there is a standard PHP routine in Unraid that I can use to check that the Unraid version meets the requirements for a new feature I am adding to a plugin (needs to be Unraid 6.9.0 beta 36 or higher). Ideally this routine would handle both stable and next type releases. 

 

It feels like a routine that may already be present somewhere if I could just locate it :)

Can you not just use

 

[var] => Array ( [version] => 6.9.0-beta35

  • Author
16 minutes ago, SimonF said:

Can you not just use

 

[var] => Array ( [version] => 6.9.0-beta35

does that work correctly for detecting that 6.9.0 (i. e. stable version) is greater than any beta or rc release and rc releases are greater than beta ones?  I had not thought of doing it that way so maybe I should try it to see as it is a very simple way if it works.

 

Since I do not intend to release this new feature until 6.9.0 beta 36 (or later) is released I could probably get away in practice in just checking for the 6.9.09 part of the release info, but I thought the question war worth asking anyway.

Found this code in Squid's CA helpders.

 

#################################################################

# checks the Min/Max version of an app against unRaid's version #

# Returns: TRUE if it's valid to run, FALSE if not #

#################################################################

function versionCheck($template) {

global $caSettings;

if ( $template['MinVer'] && ( version_compare($template['MinVer'],$caSettings['unRaidVersion']) > 0 ) ) return false;

if ( $template['MaxVer'] && ( version_compare($template['MaxVer'],$caSettings['unRaidVersion']) < 0 ) ) return false;

return true;

}

 

Also version is available here.

 

root@Tower:/etc# cat unraid-version 
version="6.9.0-beta35"

Edited by SimonF

  • Author

Looks like version_compare() is a standard PHP function that does what I want.

You want to use version_compare 

 

 

$unraid = parse_ini_file("/etc/unraid-version");
if ( version_compare($unraid['version'],"6.9.0-beta35",">") ) {
  we're running beta36+
} else {
  we're running <= beta35
}

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.