From dc7cbf719b1fbfb5114450bb8f660831b2787728 Mon Sep 17 00:00:00 2001 From: Nathaniel Kenschaft Date: Mon, 15 Jun 2020 20:33:27 -0400 Subject: [PATCH] started checker.py --- bgservice/checker.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bgservice/checker.py diff --git a/bgservice/checker.py b/bgservice/checker.py new file mode 100644 index 0000000..35d48fc --- /dev/null +++ b/bgservice/checker.py @@ -0,0 +1,17 @@ +import os + + +def shell_check(): + bash_history = [line.strip() for line in open(os.path.expanduser("~/.bash_history"), 'r')] + zsh_history = [line.strip() for line in open(os.path.expanduser("~/.histfile"), 'r')] + report = "Suspicios commands found:\n" + for i in bash_history + zsh_history: + if "git" in i: + report += i + "\n" + if report != "Suspicios commands found:\n": + return report + return "Nothing suspicious found in bash or zsh history." + + +def file_check(dir_): +