소스 검색

Update upgrade.sh

fix: use the right command
yrluke 1 년 전
부모
커밋
3e75e7c6b6
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      release/latest/upgrade.sh

+ 2 - 3
release/latest/upgrade.sh

@@ -160,9 +160,8 @@ else
     fi
 fi
 
-container_id=$(docker ps --filter ancestor=chaitin/safeline-tengine --format '{{.ID}}')
-mount_path=$(docker inspect --format '{{range .Mounts}}{{if eq .Destination "/logs"}}{{.Source}}{{end}}{{end}}' $container_id)
-safeline_path=$(dirname $mount_path)
+container_id=$(docker ps -n 1 --filter name=.*safeline-mgt.* --format '{{.ID}}')
+safeline_path=$(docker inspect --format '{{index .Config.Labels "com.docker.compose.project.working_dir"}}' $container_id)
 
 while [ -z "$safeline_path" ]; do
     echo -e -n "\033[34m[SafeLine] 未发现正在运行的雷池,请输入雷池安装路径 (留空则为 '$(pwd)'): \033[0m"