[ server ] [ executor ] - optimize code -4
This commit is contained in:
@@ -187,6 +187,10 @@ DownloadAllFile() {
|
|||||||
|
|
||||||
FunctionStart
|
FunctionStart
|
||||||
|
|
||||||
|
colorEcho $RED "[CLEAN_UP] clean the old octopus agent staff !"
|
||||||
|
rm -rf $OctopusAgentPath/lib
|
||||||
|
rm -rf $OctopusAgentPath/
|
||||||
|
|
||||||
mkdir -p $OctopusAgentPath
|
mkdir -p $OctopusAgentPath
|
||||||
mkdir -p $OctopusAgentPath/lib
|
mkdir -p $OctopusAgentPath/lib
|
||||||
|
|
||||||
@@ -200,7 +204,8 @@ DownloadAllFile() {
|
|||||||
colorEcho $BLUE "start to download octopus agent !"
|
colorEcho $BLUE "start to download octopus agent !"
|
||||||
# check for latest version
|
# check for latest version
|
||||||
# download the lasted jar
|
# download the lasted jar
|
||||||
. ./lib/wdd-lib-os.sh
|
cd /optopus-agent
|
||||||
|
. ./shell/lib/wdd-lib-os.sh
|
||||||
|
|
||||||
CheckAndDownloadLatestVersion
|
CheckAndDownloadLatestVersion
|
||||||
|
|
||||||
@@ -268,7 +273,7 @@ InstallJDKPackage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
systemdAgent(){
|
systemdAgent(){
|
||||||
local JAVA_OPTS="-Xms128m -Xmx512m -Dspring.spring.active=k3s -Dspring.cloud.nacos.config.extension-configs=[group=k3s,data-id=common-k3s.yaml]"
|
local JAVA_OPTS="-Xms128m -Xmx512m -Dfile.encoding=utf-8 --spring.profiles.active=k3s --spring.cloud.nacos.config.group=k3s --spring.cloud.nacos.config.extension-configs[0].dataId=common-k3s.yaml --spring.cloud.nacos.config.extension-configs[0].group=k3s"
|
||||||
|
|
||||||
# https://www.baeldung.com/linux/run-java-application-as-service
|
# https://www.baeldung.com/linux/run-java-application-as-service
|
||||||
|
|
||||||
|
|||||||
@@ -268,20 +268,20 @@ export serverIpPbV4=$public_ipv4
|
|||||||
export serverIpInV4=
|
export serverIpInV4=
|
||||||
export serverIpPbV6=
|
export serverIpPbV6=
|
||||||
export serverIpInV6=
|
export serverIpInV6=
|
||||||
export location=$city $region $country
|
export location="$city $region $country"
|
||||||
export provider=$org
|
export provider=$org
|
||||||
export managePort=$(netstat -ntulp | grep sshd | grep -w tcp | awk '{print$4}' | cut -d":" -f2)
|
export managePort=$(netstat -ntulp | grep sshd | grep -w tcp | awk '{print$4}' | cut -d":" -f2)
|
||||||
export cpuCore=$cores @ $freq MHz
|
export cpuCore="$cores @ $freq MHz"
|
||||||
export cpuBrand=$cpuName
|
export cpuBrand=$cpuName
|
||||||
export memoryTotal=$tram
|
export memoryTotal=$tram
|
||||||
export diskTotal=$disk_total_size
|
export diskTotal=$disk_total_size
|
||||||
export diskUsage=$disk_used_size
|
export diskUsage=$disk_used_size
|
||||||
export archInfo=$arch ($lbit Bit)
|
export archInfo="$arch ($lbit Bit)"
|
||||||
export osInfo=$opsy
|
export osInfo="$opsy"
|
||||||
export osKernelInfo=$kern
|
export osKernelInfo=$kern
|
||||||
export tcpControl=$tcpctrl
|
export tcpControl=$tcpctrl
|
||||||
export virtualization=$virt
|
export virtualization=$virt
|
||||||
export ioSpeed=$ioavg MB/s
|
export ioSpeed="$ioavg MB/s"
|
||||||
export machineId=$(cat /etc/machine-id)
|
export machineId=$(cat /etc/machine-id)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
@@ -152,5 +152,7 @@ wget https://raw.githubusercontent.com/zeaslity/ProjectOctopus/main/source/src/m
|
|||||||
|
|
||||||
apt-cache madison openjdk-11-jdk | head -n 1 | awk '{print$3}'
|
apt-cache madison openjdk-11-jdk | head -n 1 | awk '{print$3}'
|
||||||
|
|
||||||
|
java -jar /octopus-agent/agent.jar -Xms128m -Xmx512m -Dfile.encoding=utf-8 --spring.profiles.active=k3s --spring.cloud.nacos.config.group=k3s --spring.cloud.nacos.config.extension-configs[0].dataId=common-k3s.yaml --spring.cloud.nacos.config.extension-configs[0].group=k3s
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user