fix -start.sh
This commit is contained in:
@@ -42,21 +42,28 @@ __strong_size() {
|
||||
|
||||
__check_process() {
|
||||
if [[ $(docker ps -aqf name=UMI-agent | wc -l) -eq 0 ]]; then
|
||||
_id=$(cat /host/workspace/id 2>/dev/null)
|
||||
[[ -z "$_id" ]] && return
|
||||
|
||||
[[ -z "$CACHE" ]] && return
|
||||
[[ -z "$FILE_PATH_START" ]] && return
|
||||
_strong_size=$(__strong_size)
|
||||
_cmd="$CACHE/$FILE_PATH_START/docker-deploy -storage-directory $CACHE/$FILE_PATH_START -storage-size $_strong_size -channel-id CBYWAKOA03B5320231107102110898 -vendor UMI -orgcode A03B53 -thirdparty-sn $_id -event deploy >/"
|
||||
|
||||
nsenter --mount=/host/proc/1/ns/mnt --net=/host/proc/1/ns/net sh -c \
|
||||
"$CACHE/$FILE_PATH_START/docker-deploy -storage-directory $CACHE/$FILE_PATH_START -storage-size $_strong_size -channel-id CBYWAKOA03B5320231107102110898 -vendor UMI -orgcode A03B53 -thirdparty-sn $_id -event deploy >/dev/null 2>&1 &"
|
||||
echo "nsenter --mount=/host/proc/1/ns/mnt --net=/host/proc/1/ns/net sh -c $CACHE/$FILE_PATH_START/docker-deploy -storage-directory $CACHE/$FILE_PATH_START -storage-size $_strong_size -channel-id CBYWAKOA03B5320231107102110898 -vendor UMI -orgcode A03B53 -thirdparty-sn $_id -event deploy" >>/apps/data/cmdline.sh
|
||||
"$_cmd"
|
||||
echo "nsenter --mount=/host/proc/1/ns/mnt --net=/host/proc/1/ns/net sh -c \"$_cmd\"" >>/apps/data/cmdline.sh
|
||||
fi
|
||||
}
|
||||
|
||||
__main() {
|
||||
{
|
||||
if [[ -z "$_id" ]]; then
|
||||
_id=$(cat /host/workspace/id 2>/dev/null)
|
||||
fi
|
||||
# 防止环境变量有问题
|
||||
if [[ -z "$CACHE" ]]; then
|
||||
CACHE=$(cat /host/workspace/runc-rootfs/biz-u-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-u-arm32-*/config.json | jq -r '.process.env[]' | awk -F = '/FILE_PATH_START/{print $NF}')
|
||||
fi
|
||||
|
||||
_strong_path="/storage/ul-dx"
|
||||
_docker_deploy_path="$_strong_path/docker-deploy"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user