-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathmain.sh
More file actions
executable file
·48 lines (42 loc) · 1022 Bytes
/
Copy pathmain.sh
File metadata and controls
executable file
·48 lines (42 loc) · 1022 Bytes
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
#!/bin/bash
# 定义日志函数
log() {
local level=$1
local message=$2
local timestamp
timestamp=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $message"
}
# 执行 ip_init.js
log "INFO" "开始执行 ip_init.js"
if node ip_init.js; then
log "INFO" "ip_init.js 执行成功"
else
log "ERROR" "ip_init.js 执行失败"
exit 1
fi
# 执行 iptest.go
log "INFO" "开始执行 iptest.go"
if go run iptest.go -file ip.txt -outfile ip_tq.csv -max 20 -speedtest 0; then
log "INFO" "iptest.go 执行成功"
else
log "ERROR" "iptest.go 执行失败"
exit 1
fi
# 执行 ip_tq.js
log "INFO" "开始执行 ip_tq.js"
if node ip_tq.js; then
log "INFO" "ip_tq.js 执行成功"
else
log "ERROR" "ip_tq.js 执行失败"
exit 1
fi
# 执行 proxyip.js
# log "INFO" "开始执行 proxyip.js"
# if node proxyip.js; then
# log "INFO" "proxyip.js 执行成功"
# else
# log "ERROR" "proxyip.js 执行失败"
# exit 1
# fi
log "INFO" "所有脚本执行完毕"