Skip to content
Snippets Groups Projects
Commit 28aaaf37 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Perform a Synchronet version check and warn if it's not equal to the latest

... so yeah, most *nix sysops will get a warning about running something newer
than the latest release.
parent 24cb34bb
No related branches found
No related tags found
No related merge requests found
// Sanity-check a Synchronet BBS installation
// @format.tab-size 4
"use strict";
const REVISION = '1.19';
const REVISION = '1.20';
require("http.js", 'HTTPRequest');
require("sbbsdefs.js", 'USER_DELETED');
function check_codes(desc, grp_list, sub_list)
......@@ -27,6 +29,31 @@ function check_codes(desc, grp_list, sub_list)
var tests = {
check_version: function(options)
{
var url = "https://gitlab.synchro.net/main/sbbs/-/raw/master/install/sbbs.json";
var http_request = new HTTPRequest();
try {
var contents = http_request.Get(url);
} catch(e) {
return e.message;
}
try {
var obj = JSON.parse(contents);
} catch(e) {
return format("%s: '%s'", e.message, lfexpand(contents));
}
if(obj.valid === true) {
if(obj.release.version_num > system.version_num)
return format("Synchronet %s (latest release by %s) is newer than %s"
,obj.release.version, obj.release.by, system.full_version);
if(obj.release.version_num < system.version_num)
return format("Synchronet %s (latest release by %s) is older than %s"
,obj.release.version, obj.release.by, system.full_version);
}
return true;
},
check_sysop: function(options)
{
var output = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment