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()
|
tunnelproc.wait()
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
print("Downloading Cloudflare Tunnel for Windows...")
|
if os.path.exists("cloudflared.exe"):
|
||||||
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')
|
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:
|
else:
|
||||||
print("Downloading Cloudflare Tunnel for Linux...")
|
if os.path.exists("cloudflared-linux-amd64"):
|
||||||
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')
|
print("Cloudflared file exists, reusing it...")
|
||||||
subprocess.run("chmod +x 'cloudflared-linux-amd64'", shell=True)
|
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 = threading.Thread(target=run_tunnel)
|
||||||
tunnel_thread.start()
|
tunnel_thread.start()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue