10
mode = os.fstat(0).st_mode
11
if stat.S_ISFIFO(mode):
12
content = sys.stdin.read()
13
elif stat.S_ISREG(mode):
14
content = sys.stdin.read()
17
if len(args) == 1 and os.path.exists(args[0]):
18
with open(args[0], 'r') as infile:
19
content = infile.read()
21
str_args = ' '.join(args)
25
if os.path.exists('/usr/bin/fpaste'):
26
p = subprocess.Popen(['/usr/bin/fpaste'], stdin=subprocess.PIPE)
27
p.communicate(content.encode("UTF-8"))
29
p = subprocess.Popen(['nc', 'termbin.com', '9999'], stdin=subprocess.PIPE)
30
p.communicate(content.encode("UTF-8"))