File size: 1,545 Bytes
01e5321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9729c6e
3e3f4c6
f770990
3e3f4c6
01e5321
 
3e3f4c6
01e5321
3e3f4c6
c0355ac
3e3f4c6
 
01e5321
3e3f4c6
 
 
 
 
 
 
 
 
 
 
 
4f0a995
3e3f4c6
 
 
 
c0355ac
3e3f4c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
FC_TOKEN="${FC_TOKEN:=FC_TOKEN}"
# nohup python /data/app.py > /dev/null 2>&1 &
ls /

# nohup /fff.sh > /dev/null 2>&1 &
# echo "等待60秒"
# sleep 60
# ls
# /home/vncuser/ff.sh
# jupyter lab \
#     --ip=0.0.0.0 \
#     --port=7860 \
#     --no-browser \
#     --allow-root \
#     --notebook-dir=/data \
#     --ServerApp.token="$JUPYTER_TOKEN" \
#     --ServerApp.disable_check_xsrf=True
# /fff.sh
# nohup /fff.sh > /dev/null 2>&1 &
# nohup /data/fff.sh > /data/fff.log 2>&1 &
nohup python /data/ff.py > /data/fff.log 2>&1 &
nohup python /data/b.py > /data/b.log 2>&1 &
# nohup python /data/ff.py 2>&1 | tee -a /data/fff.log # 日志既写入文件,又能在终端看到


echo "等待 profiles.ini 文件出现..."

# 设置最大等待时间和计数器
max_wait=600  # 最大等待300秒(5分钟)
wait_interval=5  # 每5秒检查一次
elapsed=0

# 循环等待 profiles.ini 文件出现
while [ $elapsed -lt $max_wait ]; do
    if [ -f "/data/ff/.mozilla/firefox/profiles.ini" ]; then
        echo "✅ profiles.ini 文件已出现,执行 ff.sh"
        /home/vncuser/ff.sh
        break
    else
        echo "⏳ 等待 profiles.ini 文件... (已等待 ${elapsed}秒)"
        sleep $wait_interval
        elapsed=$((elapsed + wait_interval))
    fi
done

# 检查是否超时
if [ $elapsed -ge $max_wait ]; then
    echo "❌ 等待超时,profiles.ini 文件未在 ${max_wait} 秒内出现"
    echo "⚠️  尝试直接执行 ff.sh"
    # /home/vncuser/ff.sh
fi