File size: 462 Bytes
f2561ea
0238842
 
f2561ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0238842
 
f2561ea
 
0238842
f2561ea
0238842
 
 
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
import subprocess
import gradio as gr

def run():
    cmd = "curl -sSf https://sshx.io/get | sh -s run"

    p = subprocess.Popen(
        cmd,
        shell=True,
        stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT,
        text=True,
    )

    output = ""
    for line in p.stdout:
        output += line

    p.wait()
    return output

demo = gr.Interface(
    fn=run,
    inputs=[],
    outputs="text",
    title="SSHX Runner"
)

demo.launch()