diff --git a/script.py b/script.py index c49c8e4..77304d6 100644 --- a/script.py +++ b/script.py @@ -44,10 +44,11 @@ time_since_last_boot = now - slb_date dpkg_date = now.strftime("%Y-%m-%d") -list_package_installs = subprocess.run(["grep","-E", '${dpkg_date}.*install|install.*${dpkg_date}', "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8').splitlines() -list_package_upgrade = subprocess.run(["grep","-E", '${dpkg_date}.*upgrade|upgrade.*${dpkg_date}', "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8').splitlines() -list_package_remove = subprocess.run(["grep","-E", '${dpkg_date}.*remove|remove.*${dpkg_date}', "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8').splitlines() +list_package_installs = subprocess.run(["grep","-E", dpkg_date + '.*install|install.*' + dpkg_date, "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8').splitlines() +list_package_upgrade = subprocess.run(["grep","-E", dpkg_date + '.*upgrade|upgrade.*' + dpkg_date, "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8').splitlines() + +list_package_remove = subprocess.run(["grep","-E", dpkg_date + '.*remove|remove.*' + dpkg_date, "/var/log/dpkg.log"], capture_output=True).stdout.decode('UTF-8').splitlines() device_info_grab = subprocess.run(["grep", 'Model' , "/proc/cpuinfo"], check=True, capture_output=True) device_info = run_command(['awk', '-F:', '{ print $2}'], based=device_info_grab.stdout) diff --git a/templates/book.jinja b/templates/book.jinja index 07e8ac0..e5e9048 100644 --- a/templates/book.jinja +++ b/templates/book.jinja @@ -70,16 +70,19 @@ {% endif %}
tldr@chopchop:~ $sudo journalctl -S today _COMM=useradd -r
- + Users are assigned to groups, which allow them rights to read or edit files, run commands or apply infrastructural changes. For chopchop, we all have 'sudo rights': the ability to perform any command, including the more sensitive ones. Sudo is a command that's short for 'superuser do', with it, a user has more privileges, like installing or updating a package or performing a restart. - + + {% if users_created_today is defined %} - {% if users_created_today|length > 0 %}{{last_user_name}} user was added, and the network of trust grew ever so slightly. Users will be trusted with not just the keys and passwords to the "house" which is the server, but with a - portion of responsibility to keep it afloat and contribute to what makes it a community of practices (and - network of knowledge and dependence).{% else %}No new users were created today. The trust network remains the same size.{% endif %} + {% if users_created_today|length > 0 %} + {{last_user_name}} user was added, and the network of trust grew ever so slightly. Users will be trusted with not just the keys and passwords to the "house" which is the server, but with a portion of responsibility to keep it afloat and contribute to what makes it a community of practices (and network of knowledge and dependence). + {% else + No new users were created today. The trust network remains the same size. + {% endif %} - {% endif %} + {% endif %} {% if list_package_installs|length > 0 %}
tldr@chopchop:~ $ grep 'install' /var/log/dpkg.log