mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-10-29 17:22:23 +00:00
36 lines
748 B
Ucode
36 lines
748 B
Ucode
if (!args.id || !args.server || !args.port || !args.token || !args.timeout) {
|
|
result_json({
|
|
"error": 2,
|
|
"text": "Invalid parameters.",
|
|
"resultCode": -1
|
|
});
|
|
|
|
return;
|
|
}
|
|
|
|
if (restrict.rtty) {
|
|
result_json({
|
|
"error": 2,
|
|
"text": "RTTY is restricted.",
|
|
"resultCode": -1
|
|
});
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
cursor.load("rtty");
|
|
cursor.set("rtty", "@rtty[-1]", "enable", 1);
|
|
cursor.set("rtty", "@rtty[-1]", "id", args.id);
|
|
cursor.set("rtty", "@rtty[-1]", "host", args.server);
|
|
cursor.set("rtty", "@rtty[-1]", "port", args.port);
|
|
cursor.set("rtty", "@rtty[-1]", "token", args.token);
|
|
cursor.set("rtty", "@rtty[-1]", "timeout", args.timeout);
|
|
cursor.commit();
|
|
|
|
system("/etc/init.d/rtty restart");
|
|
result_json({
|
|
"error": 0,
|
|
"text": "Command was executed"
|
|
});
|