Skip to content

Commit

Permalink
Merge pull request #6 from loliart-lae/dev
Browse files Browse the repository at this point in the history
修复配置文件下载错误
  • Loading branch information
BingYanchi authored Nov 4, 2021
2 parents 5e021ac + f4fa09a commit e82f885
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lae-tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ def printTunnel(is_arg):
# 下载配置文件
def get_config(id):

if (args.latest and os.path.exists(frpc_config.format(id=id))): return True

result = sendrequest(get_config_url + str(id) + "?api_token={}".format(token), True)

if (result == "error"): return False
Expand All @@ -155,18 +153,24 @@ def runTunnel(tunnels):

for tunnel_id in tunnels:
if (tunnel_id in tunnel):
# 下载配置文件
if (get_config(tunnel_id)):
# 启动程序
command = frpc_command.format(file=frpc_config.format(id=tunnel_id))

th_frpGo = Thread(target=runCmd, args=(command,))
th_frpGo.setDaemon(True)
th_frpGo.start()

if (args.latest and os.path.exists(frpc_config.format(id=id))):
success += 1
else:
print(language['warn'] + language['tunnel_get_config_warn'].format(id=tunnel_id))
# 下载配置文件
if (get_config(tunnel_id)):
success += 1
# 间隔
time.sleep(0.3)
else:
print(language['warn'] + language['tunnel_get_config_warn'].format(id=tunnel_id))
continue

# 启动程序
command = frpc_command.format(file=frpc_config.format(id=tunnel_id))

th_frpGo = Thread(target=runCmd, args=(command,))
th_frpGo.setDaemon(True)
th_frpGo.start()

if (success == 0): return False
else: return True
Expand Down

0 comments on commit e82f885

Please sign in to comment.