some fallbacks

main
vitrinekast 8 months ago
parent 2764beb097
commit b823b7bbc8

@ -112,12 +112,9 @@ output = template.render(
kitchen_services = kitchen_services, kitchen_services = kitchen_services,
ip_address = ip_address, ip_address = ip_address,
logins_today = run_command(['grep', '-v', "Boot"], based=logins_today_log.stdout).splitlines(), logins_today = run_command(['grep', '-v', "Boot"], based=logins_today_log.stdout).splitlines(),
list_groups = run_command(["getent","group"]).splitlines(),
list_active_services = run_command(["sudo", "service", "--status-all"]).splitlines(), list_active_services = run_command(["sudo", "service", "--status-all"]).splitlines(),
debian_version = run_command(["cat", "/etc/debian_version"]), debian_version = run_command(["cat", "/etc/debian_version"]) if time_ago_arg else False,
kernel_version = run_command(["uname","-a"]), hostname = run_command(["hostname","-i"]) if time_ago_arg else False,
hostname = run_command(["hostname","-i"]),
groups_created = run_command(['grep', '-v', "Boot"], based=groupadd_today_log.stdout).splitlines(), groups_created = run_command(['grep', '-v', "Boot"], based=groupadd_today_log.stdout).splitlines(),
groups_removed = run_command(['grep', '-v', "Boot"], based=groupremove_today_log.stdout).splitlines(), groups_removed = run_command(['grep', '-v', "Boot"], based=groupremove_today_log.stdout).splitlines(),
user_modified = run_command(['grep', '-v', "Boot"], based=usermod_today_log.stdout).splitlines(), user_modified = run_command(['grep', '-v', "Boot"], based=usermod_today_log.stdout).splitlines(),

@ -64,22 +64,22 @@
<h1>The state of chopchop on {{now}}</h1> <h1>The state of chopchop on {{now}}</h1>
<hr /> <hr />
<p><em>tldr@chopchop:~ $</em>whoami</p> <p><em>tldr@chopchop:~ $</em>whoami</p>
<p>{{ device_info }}</p> <p>{{ device_info if device_info else '' }}</p>
<p>{{ hostname }}</p> <p>{{ hostname if hostname else '' }}</p>
<p>{{ ip_address }}</p> <p>{{ ip_address if ip_address else '' }}</p>
<mark> <mark>
XPUB 1 users use chopchop as a shared community server. XPUB 1 users use chopchop as a shared community server.
chopchop is usually located in the Piet Zwart Wijnhaven building, although for this occassion it is resting on the chopchop is usually located in the Piet Zwart Wijnhaven building, although for this occassion it is resting on the
shelf bellow this e-reader. shelf bellow this e-reader.
</mark> </mark>
{% if since_last_boot is defined %}
<p><em>tldr@chopchop:~ $</em>uptime -s</p> <p><em>tldr@chopchop:~ $</em>uptime -s</p>
<mark> <mark>
Uptime is the amount of time a server has been up, available, running, working, executing. This is time that is Uptime is the amount of time a server has been up, available, running, working, executing. This is time that is
not spent idle, but time spent busy serving. not spent idle, but time spent busy serving.
</mark> </mark>
<p>{{ since_last_boot }}</p> <p>{{ since_last_boot }}</p>
{% if since_last_boot is defined %}
<mark> <mark>
{% if days_since_last_boot|int > 14 %}This is unusual, we are used to our server crashing quite often, especially {% if days_since_last_boot|int > 14 %}This is unusual, we are used to our server crashing quite often, especially
when we are all sharing the space and editing at the same time. Our server, chopchop, chops up time into small when we are all sharing the space and editing at the same time. Our server, chopchop, chops up time into small

Loading…
Cancel
Save