qiqi657s commited on
Commit
e1b47a0
·
verified ·
1 Parent(s): 315d050

Create init_chrome.sh

Browse files
Files changed (1) hide show
  1. init_chrome.sh +15 -0
init_chrome.sh ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # 获取环境变量
4
+ PROXY=${PROXY:-""}
5
+
6
+ # 检查是否需要设置代理
7
+ if [ -n "$PROXY" ]; then
8
+ CMD="/usr/bin/google-chrome-stable --remote-debugging-port=9200 --user-data-dir=/app/cache --proxy-server=$PROXY --headless=new --no-sandbox --disable-gpu"
9
+ else
10
+ CMD="/usr/bin/google-chrome-stable --remote-debugging-port=9200 --user-data-dir=/app/cache --headless=new --no-sandbox --disable-gpu"
11
+ fi
12
+
13
+ # 启动 Chrome 浏览器(后台运行)
14
+ echo "Starting Chrome..."
15
+ $CMD