mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-13 20:04:45 +08:00
23 lines
497 B
Plaintext
23 lines
497 B
Plaintext
#!/usr/bin/ucode
|
|
|
|
'use strict';
|
|
|
|
import { readfile } from 'fs';
|
|
|
|
const methods = {
|
|
get_congestions: {
|
|
call: function() {
|
|
const allowed_congestion = '/proc/sys/net/ipv4/tcp_allowed_congestion_control';
|
|
const available_congestion = '/proc/sys/net/ipv4/tcp_available_congestion_control';
|
|
|
|
const content = trim(readfile(allowed_congestion));
|
|
if (content)
|
|
return { algorithm: split(content, ' ') };
|
|
else
|
|
return { algorithm: [] };
|
|
}
|
|
}
|
|
};
|
|
|
|
return { 'luci.natmap': methods };
|