[agent]-[executor] optimize execution code

This commit is contained in:
IceDerce
2022-12-27 14:58:47 +08:00
parent 60117c2e5c
commit 9bc516bdbd
14 changed files with 139 additions and 67 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/zsh
RED="31m" ## 姨妈红
GREEN="32m" ## 水鸭青
@@ -348,26 +348,29 @@ GenerateSystemInfo() {
machineNumber=99
fi
export serverName="${city}-${hostArch}-${machineNumber}"
export serverIpPbV4="$public_ipv4"
export serverIpInV4=""
export serverIpPbV6=""
export serverIpInV6=""
export location="$city $region $country"
export provider="$org"
export managePort="$(netstat -ntulp | grep sshd | grep -w tcp | awk '{print$4}' | cut -d":" -f2)"
export cpuCore="$cores @ $freq MHz"
export cpuBrand="$cpuName"
export memoryTotal="$tram"
export diskTotal="$disk_total_size"
export diskUsage="$disk_used_size"
export archInfo="$arch ($lbit Bit)"
export osInfo="$opsy"
export osKernelInfo="$kern"
export tcpControl="$tcpctrl"
export virtualization="$virt"
export ioSpeed="$ioavg MB/s"
export machineId="$(cat /host/etc/machine-id)"
cat >current-env.txt <<EOF
serverName="${city}-${hostArch}-${machineNumber}"
serverIpPbV4="$public_ipv4"
serverIpInV4=""
serverIpPbV6=""
serverIpInV6=""
location="$city $region $country"
provider="$org"
managePort="$(netstat -ntulp | grep sshd | grep -w tcp | awk '{print$4}' | cut -d":" -f2)"
cpuCore="$cores @ $freq MHz"
cpuBrand="$cpuName"
memoryTotal="$tram"
diskTotal="$disk_total_size"
diskUsage="$disk_used_size"
archInfo="$arch ($lbit Bit)"
osInfo="$opsy"
osKernelInfo="$kern"
tcpControl="$tcpctrl"
virtualization="$virt"
ioSpeed="$ioavg MB/s"
machineId="$(cat /host/etc/machine-id)"
EOF
FunctionEnd
}