This commit is contained in:
Wang Sen Di
2025-11-27 15:53:25 +08:00
parent 1fefea54ed
commit 1090ef558c

View File

@@ -42,15 +42,6 @@ __check_process() {
_ps_cmd="ps -ef | grep 'airship-agent serve' | grep -v grep"
if [[ $(nsenter --mount=/host/proc/1/ns/mnt --net=/host/proc/1/ns/net sh -c "$_ps_cmd" | wc -l) -eq 0 ]]; then
_id=$(cat /host/workspace/id 2>/dev/null)
[[ -z "$_id" ]] && return
# 防止环境变量有问题
if [[ -z "$CACHE" ]]; then
:
CACHE=$(cat /host/workspace/runc-rootfs/biz-m-arm32-*/config.json | jq -r '.process.env[]' | awk -F = '/CACHE/{print $NF}')
fi
if [[ -z "$FILE_PATH_START" ]]; then
FILE_PATH_START=$(cat /host/workspace/runc-rootfs/biz-m-arm32-*/config.json | jq -r '.process.env[]' | awk -F = '/FILE_PATH_START/{print $NF}')
fi
_cmd="cd $CACHE/$FILE_PATH_START && ./airship-agent serve \
--workspace $CACHE/$FILE_PATH_START \
--class box \
@@ -71,15 +62,23 @@ __check_process() {
}
__main() {
{
[[ -z "$_id" ]] && return
# 防止环境变量有问题
if [[ -z "$CACHE" ]]; then
:
CACHE=$(cat /host/workspace/runc-rootfs/biz-m-arm32-*/config.json | jq -r '.process.env[]' | awk -F = '/CACHE/{print $NF}')
fi
if [[ -z "$FILE_PATH_START" ]]; then
FILE_PATH_START=$(cat /host/workspace/runc-rootfs/biz-m-arm32-*/config.json | jq -r '.process.env[]' | awk -F = '/FILE_PATH_START/{print $NF}')
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') start.sh"
_strong_path="/storage/ml-px"
_strong_path="$CACHE/$FILE_PATH_START"
_airship_agent_path="$_strong_path/airship-agent"
echo "path: $_airship_agent_path"
mkdir -p "$_airship_agent_path" 2>/dev/null
__check_md5
__check_process
}
}
__main