File size: 1,625 Bytes
01e5321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9729c6e
bc46e59
 
76b2399
bc46e59
 
e0973f8
 
01e5321
 
3e3f4c6
01e5321
3e3f4c6
e0973f8
3e3f4c6
 
01e5321
4a87191
 
 
 
 
 
 
 
 
 
e0973f8
4a87191
 
 
 
 
 
 
 
 
 
 
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
55
56
57
58
59
#!/bin/bash
# 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 /home/vncuser/bf.py > /home/vncuser/fff.log 2>&1 &
# nohup python /data/b.py > /data/b.log 2>&1 &

nohup python /home/vncuser/ff.py  > /home/vncuser/fff.log 2>&1 &
# nohup python /home/vncuser/ff.py 2>&1 | tee -a /home/vncuser/fff.log # 日志既写入文件,又能在终端看到


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

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

# /home/vncuser/ff.sh

# 循环等待 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}秒)"
        cat /home/vncuser/fff.log
        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