From 3a2ba97e65a4fd4017b808563152c6216679cb64 Mon Sep 17 00:00:00 2001 From: vitrinekast Date: Wed, 27 Mar 2024 00:37:47 +0100 Subject: [PATCH] .. --- script.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script.py b/script.py index 9b1d647..3f47aeb 100644 --- a/script.py +++ b/script.py @@ -91,12 +91,12 @@ journal_today = subprocess.run(["sudo", "journalctl","_COMM=systemd-logind","_CO kitchen_services = run_command(["sudo", "journalctl", "-u", "kitchen-stove.service", "-u", "kitchen-bin.service", "-u", "kitchen-fridge.service", "-r", "-n"] + get_journalctl_on()).splitlines() try: - groups_created = subprocess.run(['grep','groupadd'], capture_output=True, input=journal_today.stdout)..stdout.decode('UTF-8').strip().splitlines() - groups_removed = subprocess.run(['grep','groupremove'], capture_output=True, input=journal_today.stdout)..stdout.decode('UTF-8').strip().splitlines() - users_created_today = subprocess.run(['grep','useradd'], capture_output=True, input=journal_today.stdout)..stdout.decode('UTF-8').strip().splitlines() - user_modified = subprocess.run(['grep','usermod'], capture_output=True, input=journal_today.stdout)..stdout.decode('UTF-8').strip().splitlines() - user_deleted = subprocess.run(['grep','userdel'], capture_output=True, input=journal_today.stdout)..stdout.decode('UTF-8').strip().splitlines() - logins_today = subprocess.run(['grep','New session'], capture_output=True, input=journal_today.stdout)..stdout.decode('UTF-8').strip().splitlines() + groups_created = subprocess.run(['grep','groupadd'], capture_output=True, input=journal_today.stdout).stdout.decode('UTF-8').strip().splitlines() + groups_removed = subprocess.run(['grep','groupremove'], capture_output=True, input=journal_today.stdout).stdout.decode('UTF-8').strip().splitlines() + users_created_today = subprocess.run(['grep','useradd'], capture_output=True, input=journal_today.stdout).stdout.decode('UTF-8').strip().splitlines() + user_modified = subprocess.run(['grep','usermod'], capture_output=True, input=journal_today.stdout).stdout.decode('UTF-8').strip().splitlines() + user_deleted = subprocess.run(['grep','userdel'], capture_output=True, input=journal_today.stdout).stdout.decode('UTF-8').strip().splitlines() + logins_today = subprocess.run(['grep','New session'], capture_output=True, input=journal_today.stdout).stdout.decode('UTF-8').strip().splitlines() except subprocess.CalledProcessError as e: raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))