how to check latest version?

B3rt

Verified User
Joined
Oct 12, 2007
Messages
81
Is there a way to check the latest DA version by script?

I am using the API to get the current version of DA, I am looking for a way to check the latest version by script without to having to look on the DA website.

Is there a simple way to retrieve this?
 
Just to be a little more specific

/usr/local/directadmin/custombuild/build versions
 
As i wrote: i need to check this by a (website) script, this means not by the DA server itself
And that is what we gave you. We gave a command line option that does not use directadmin itself.

I think you meant versions.php. Using this would require you to parse and extract from the html the version, not a very easy thing to do. Whereas the command line gives you a simple:

Code:
/usr/local/directadmin/custombuild/build versions | grep "Latest version of DirectAdmin"
Latest version of DirectAdmin: 1.36.2

This is a lot easier to use data from that than a web page.
 
Floyd, before doing this check don't you have to make sure that custombuild has the most current information?

Jeff
 
You may need to run ./build update_versions first.

I set up the cron job to do that already anyway so I don't have to think about it.
 
If you want to check the version with php, it is easier to fetch this url then to execute from command line to a path a website shouldn't have access to. Removing the javascript is also not that big a trouble.

PHP:
<?php

$version = file_get_contents('http://www.directadmin.com/version.php');
$version = str_replace("document.write('", '', $version);
$version = str_replace("');", '', $version);

print $version;

?>
 
If you want to check the version with php, it is easier to fetch this url then to execute from command line to a path a website shouldn't have access to.

Nobody said anything about doing it form a web site. The OP wanted to do it with a script without using DA on his server or accessing the DA web site, according to the original post.
 
Starting post was vague indeed, but he replied that he found 'it', giving the vesion.php url and saying "(website) script".
 
Yes without knowing exactly what he is trying to accomplish and how, its hard to give the best answer. Whoever comes across this thread now has 2 ways to choose from.
 
Directadmin emails show version

To find out which version of Direct Admin is running just look at the email notification after making a backup, in the bottom it says; Automated Message Generated by DirectAdmin 1.51.3
 
Without using PHP, you could use curl (installed on most distribution):

Code:
curl -s https://www.directadmin.com/version.php | grep -Eo "[0-9]+\.[0-9]+"

output:

Code:
1.615
 
Last edited:
We have migrated to storing latest version data in DNS. You can retrieve it with any DNS client, or use DoH and retrieve it with HTTP client.

Examples using dig:

Code:
$ dig +short -t txt alpha-version.directadmin.com beta-version.directadmin.com current-version.directadmin.com stable-version.directadmin.com
"v=1.63.0&commit=b722beb3084ed30834eeefc9641b28751d93b05d"
"v=1.63.0&commit=6f7ee16b88a4b28517d202f826e7e348de8973d1"
"v=1.63.0&commit=6f7ee16b88a4b28517d202f826e7e348de8973d1"
"v=1.62.4&commit=6e92027a2bb1dca85b008a66ddf39c19df2cccea"

$ dig +short -t txt current-version.directadmin.com | sed 's|.*v=\([0-9.]*\).*|\1|'
1.63.0

Exampes using DoH from Google or Cloudflare with curl:

Code:
$ curl -s 'https://dns.google/resolve?name=current-version.directadmin.com&type=txt'
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,"Question":[{"name":"current-version.directadmin.com.","type":16}],"Answer":[{"name":"current-version.directadmin.com.","type":16,"TTL":193,"data":"v=1.63.0\u0026commit=6f7ee16b88a4b28517d202f826e7e348de8973d1"}]}

$ curl -s -H 'Accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=current-version.directadmin.com&type=txt'
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,"Question":[{"name":"current-version.directadmin.com","type":16}],"Answer":[{"name":"current-version.directadmin.com","type":16,"TTL":272,"data":"\"v=1.63.0&commit=6f7ee16b88a4b28517d202f826e7e348de8973d1\""}]}

$ curl -s 'https://dns.google/resolve?name=current-version.directadmin.com&type=txt' |  sed 's|.*v=\([0-9.]*\).*|\1|'
1.63.0

curl -s -H 'Accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=current-version.directadmin.com&type=txt' | sed 's|.*v=\([0-9.]*\).*|\1|'
1.63.0
 
Isn't the question more around How to know what Version of DA is running on the server via a command line? NOT What is the latest version DA has created.
 
From what I understood, OP wanted to check DA version externally and not by using DA server. So he was not interested with custombuild from DA server and he said he found the external version to use via script. Before this, version.php was the only place to check the latest version of DA externally.

As i wrote: i need to check this by a (website) script, this means not by the DA server itself
Found it: http://www.directadmin.com/version.php
 
Back
Top