diff --git a/files/usr/bin/pastebin b/files/usr/bin/pastebin index 3f74cf5..0775e23 100755 --- a/files/usr/bin/pastebin +++ b/files/usr/bin/pastebin @@ -22,5 +22,7 @@ content = str_args if content != "": - p = subprocess.Popen(["/usr/bin/gist-paste"], stdin=subprocess.PIPE) - p.communicate(content.encode("UTF-8")) + for paster in ['/usr/bin/gist-paste', '/usr/bin/fpaste']: + if os.path.exists(paster): + p = subprocess.Popen([paster], stdin=subprocess.PIPE) + p.communicate(content.encode("UTF-8")) diff --git a/files/usr/bin/upload-system-info b/files/usr/bin/upload-system-info index 2aae243..572f468 100755 --- a/files/usr/bin/upload-system-info +++ b/files/usr/bin/upload-system-info @@ -1,11 +1,11 @@ #!/usr/bin/python3 -import subprocess +import subprocess, os inxi = subprocess.Popen(['inxi', '-Fxxrzc0'], stdout=subprocess.PIPE) -gist = subprocess.Popen(['gist-paste'], stdin=inxi.stdout, stdout=subprocess.PIPE) +pastebin = subprocess.Popen(['/usr/bin/pastebin'], stdin=inxi.stdout, stdout=subprocess.PIPE) inxi.stdout.close() -output = gist.communicate()[0] -gist.wait() - +output = pastebin.communicate()[0] +output = output.split()[0] # if we have more than one URL, only use the first one +pastebin.wait() subprocess.call(['xdg-open', output])