mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 17:25:07 +02:00
try to reuse cloudflared file
This commit is contained in:
+11
-5
@@ -2143,12 +2143,18 @@ def setuptunnel():
|
||||
tunnelproc.wait()
|
||||
|
||||
if os.name == 'nt':
|
||||
print("Downloading Cloudflare Tunnel for Windows...")
|
||||
subprocess.run("curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -o cloudflared.exe", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
|
||||
if os.path.exists("cloudflared.exe"):
|
||||
print("Cloudflared file exists, reusing it...")
|
||||
else:
|
||||
print("Downloading Cloudflare Tunnel for Windows...")
|
||||
subprocess.run("curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -o cloudflared.exe", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
|
||||
else:
|
||||
print("Downloading Cloudflare Tunnel for Linux...")
|
||||
subprocess.run("curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared-linux-amd64", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
|
||||
subprocess.run("chmod +x 'cloudflared-linux-amd64'", shell=True)
|
||||
if os.path.exists("cloudflared-linux-amd64"):
|
||||
print("Cloudflared file exists, reusing it...")
|
||||
else:
|
||||
print("Downloading Cloudflare Tunnel for Linux...")
|
||||
subprocess.run("curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared-linux-amd64", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
|
||||
subprocess.run("chmod +x 'cloudflared-linux-amd64'", shell=True)
|
||||
tunnel_thread = threading.Thread(target=run_tunnel)
|
||||
tunnel_thread.start()
|
||||
except Exception as ex:
|
||||
|
||||
Reference in New Issue
Block a user