#!/usr/bin/python3
import cgi
import json
import subprocess

print("content-type: text/html")
print()

f = cgi.FieldStorage()
img = f.getvalue('i')
cname = f.getvalue('n')
cmd = "sudo podman run -itd --name {} {}".format(cname,img)
op = subprocess.getoutput(cmd)
keys=["cmd","op"]
values=[cmd,op]
op1={keys[i]:values[i] for i in range(len(keys))}
op2=json.dumps(op1)
print(op2)


07026887f44ffbca1190c51592dac999a9b808d3
<mask token>

<mask token>
print('content-type: text/html')
print()
<mask token>
print(op2)

<mask token>
print('content-type: text/html')
print()
f = cgi.FieldStorage()
img = f.getvalue('i')
cname = f.getvalue('n')
cmd = 'sudo podman run -itd --name {} {}'.format(cname, img)
op = subprocess.getoutput(cmd)
keys = ['cmd', 'op']
values = [cmd, op]
op1 = {keys[i]: values[i] for i in range(len(keys))}
op2 = json.dumps(op1)
print(op2)

import cgi
import json
import subprocess
print('content-type: text/html')
print()
f = cgi.FieldStorage()
img = f.getvalue('i')
cname = f.getvalue('n')
cmd = 'sudo podman run -itd --name {} {}'.format(cname, img)
op = subprocess.getoutput(cmd)
keys = ['cmd', 'op']
values = [cmd, op]
op1 = {keys[i]: values[i] for i in range(len(keys))}
op2 = json.dumps(op1)
print(op2)

#!/usr/bin/python3
import cgi
import json
import subprocess

print("content-type: text/html")
print()

f = cgi.FieldStorage()
img = f.getvalue('i')
cname = f.getvalue('n')
cmd = "sudo podman run -itd --name {} {}".format(cname,img)
op = subprocess.getoutput(cmd)
keys=["cmd","op"]
values=[cmd,op]
op1={keys[i]:values[i] for i in range(len(keys))}
op2=json.dumps(op1)
print(op2)

