run.sh 456 Bytes
Newer Older
wangkaixiong's avatar
init  
wangkaixiong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

apt install -y docker-compose

# 指定要检查的文件路径
file_path="./test_script/finished"

rm -rf file_path
docker compose up &
# 使用 while 循环不断检查文件是否存在
while true; do
  if [ -e "$file_path" ]; then
    echo "文件 $file_path 已存在,退出循环。"
    break
  else
    echo "文件 $file_path 不存在,继续检查..."
  fi
  sleep 1  # 等待 1 秒
done
docker compose down

echo "继续测试"