-
This commit is contained in:
@@ -42,15 +42,6 @@ __check_process() {
|
|||||||
_ps_cmd="ps -ef | grep 'airship-agent serve' | grep -v grep"
|
_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
|
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)
|
_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 \
|
_cmd="cd $CACHE/$FILE_PATH_START && ./airship-agent serve \
|
||||||
--workspace $CACHE/$FILE_PATH_START \
|
--workspace $CACHE/$FILE_PATH_START \
|
||||||
--class box \
|
--class box \
|
||||||
@@ -71,15 +62,23 @@ __check_process() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__main() {
|
__main() {
|
||||||
{
|
[[ -z "$_id" ]] && return
|
||||||
echo "$(date '+%Y-%m-%d %H:%M:%S') start.sh"
|
# 防止环境变量有问题
|
||||||
_strong_path="/storage/ml-px"
|
if [[ -z "$CACHE" ]]; then
|
||||||
_airship_agent_path="$_strong_path/airship-agent"
|
:
|
||||||
echo "path: $_airship_agent_path"
|
CACHE=$(cat /host/workspace/runc-rootfs/biz-m-arm32-*/config.json | jq -r '.process.env[]' | awk -F = '/CACHE/{print $NF}')
|
||||||
mkdir -p "$_airship_agent_path" 2>/dev/null
|
fi
|
||||||
__check_md5
|
if [[ -z "$FILE_PATH_START" ]]; then
|
||||||
__check_process
|
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="$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
|
__main
|
||||||
|
|||||||
Reference in New Issue
Block a user