try to reuse cloudflared file
This commit is contained in:
parent
d37c94bcd9
commit
20261049c9
1 changed files with 11 additions and 5 deletions
16
koboldcpp.py
16
koboldcpp.py
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue