mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: bsd status (#284)
This commit is contained in:
@@ -206,7 +206,7 @@ enum StatusCmdType {
|
||||
|
||||
/// Cmds for linux server
|
||||
const _statusCmds = [
|
||||
'echo $linuxSign',
|
||||
'echo ${SystemType.linuxSign}',
|
||||
'date +%s',
|
||||
'cat /proc/net/dev',
|
||||
'cat /etc/*-release | grep PRETTY_NAME',
|
||||
@@ -240,7 +240,7 @@ enum BSDStatusCmdType {
|
||||
|
||||
/// Cmds for BSD server
|
||||
const _bsdStatusCmd = [
|
||||
'echo $bsdSign',
|
||||
'echo ${SystemType.bsdSign}',
|
||||
'date +%s',
|
||||
'netstat -ibn',
|
||||
'uname -or',
|
||||
|
||||
@@ -9,16 +9,14 @@ enum SystemType {
|
||||
|
||||
const SystemType._(this.value);
|
||||
|
||||
static const linuxSign = '__linux';
|
||||
static const bsdSign = '__bsd';
|
||||
|
||||
static SystemType parse(String value) {
|
||||
switch (value.trim()) {
|
||||
case linuxSign:
|
||||
return SystemType.linux;
|
||||
case bsdSign:
|
||||
return SystemType.bsd;
|
||||
default:
|
||||
// Fallback to linux
|
||||
return SystemType.linux;
|
||||
if (value.contains(bsdSign)) {
|
||||
return SystemType.bsd;
|
||||
}
|
||||
return SystemType.linux;
|
||||
}
|
||||
|
||||
bool isSegmentsLenMatch(int len) => len == segmentsLen;
|
||||
@@ -32,6 +30,3 @@ enum SystemType {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const linuxSign = 'linux';
|
||||
const bsdSign = 'bsd';
|
||||
|
||||
Reference in New Issue
Block a user