opt.: install script

This commit is contained in:
lollipopkit
2024-02-23 11:01:47 +08:00
parent 37dc1056c9
commit fad3f41e58
3 changed files with 14 additions and 39 deletions

View File

@@ -33,17 +33,11 @@ enum ShellFunc {
/// Issue #168
/// Use `sh` for compatibility
// static final installShellCmd = """
// mkdir -p $_homeVar/$_srvBoxDir
// cat << 'EOF' > $_installShellPath
// ${ShellFunc.allScript}
// EOF
// chmod +x $_installShellPath
// """;
static const installerMkdirs = "mkdir -p $_homeVar/$_srvBoxDir";
static const installerShellWriter = "cat > $_installShellPath";
static const installerPermissionModifier = "chmod +x $_installShellPath";
static const installShellCmd = """
mkdir -p $_homeVar/$_srvBoxDir
cat > $_installShellPath
chmod +x $_installShellPath
""";
String get flag {
switch (this) {

View File

@@ -68,6 +68,11 @@ Future<ServerStatus> _getLinuxStatus(ServerStatusUpdateReq req) async {
try {
final cpus = OneTimeCpuStatus.parse(StatusCmdType.cpu.find(segments));
req.ss.cpu.update(cpus);
} catch (e, s) {
Loggers.parse.warning(e, s);
}
try {
req.ss.temps.parse(
StatusCmdType.tempType.find(segments),
StatusCmdType.tempVal.find(segments),