SOLVED Detect if cPanel has updates

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,239
363
cPanel Access Level
Root Administrator
Hey there! We have the following API command that connects to our update servers and displays the available update tiers:

Code:
whmapi1 get_available_tiers
You could use the values for current, edge, lts, release, and stable that are displayed in that output to determine if your server needs an update.

Let me know if that helps!
 

manoaratefy

Well-Known Member
Nov 17, 2018
58
5
8
Madagascar
cPanel Access Level
Root Administrator
Twitter
Good morning,

Thank you for your answer. The API provide available versions, but doesn't tell me my current cPanel version and/or if I need to update my server or not. Is that normal?

Command output:
Bash:
[[email protected] ~]# whmapi1 get_available_tiers
---
data:
  "11.30": 11.30.8.0
  "11.32": 11.32.7.3
  "11.34": 11.34.2.8
  "11.36": 11.36.2.12
  "11.38": 11.38.2.23
  "11.40": 11.40.1.22
  "11.42": 11.42.1.31
  "11.44": 11.44.3.5
  "11.46": 11.46.4.0
  "11.48": 11.48.5.3
  "11.50": 11.50.6.2
  "11.52": 11.52.6.6
  "11.54": 11.54.0.36
  "11.56": 11.56.0.52
  "11.58": 11.58.0.52
  "11.60": 11.60.0.48
  "11.62": 11.62.0.48
  "11.64": 11.64.0.42
  "11.66": 11.66.0.35
  "11.68": 11.68.0.39
  "11.70": 11.70.0.69
  "11.72": 11.72.0.12
  "11.74": 11.74.0.12
  "11.76": 11.76.0.22
  "11.78": 11.78.0.49
  "11.80": 11.80.0.24
  "11.82": 11.82.0.19
  "11.84": 11.84.0.22
  "11.86": 11.86.0.36
  "11.88": 11.88.0.17
  "11.90": 11.90.0.19
  "11.92": 11.92.0.9
  current: 11.92.0.9
  edge: 11.93.9999.137
  lts: 11.86.0.36
  release: 11.92.0.9
  stable: 11.92.0.9
metadata:
  command: get_available_tiers
  reason: Got tiers list
  result: 1
  version: 1
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,239
363
cPanel Access Level
Root Administrator
I'm sorry if that wasn't clear - that is the normal output for that command, but I was suggesting you use that in combination with your custom script in order to see if an update was available. I didn't mean to imply this script would take care of the whole process for you. Running the following would give you the cPanel version:

Code:
# /usr/local/cpanel/cpanel -V
92.0 (build 9)
or if you'd prefer a more plain text approach, you could run this;

Code:
# cat /usr/local/cpanel/version
11.92.0.9