Skip to main content
100%

Gist 83e1b6fcb5b1da33f595c08405f89f2a

✓ Published0🌍 Public
HHerst
Last edited Jan 5, 2025
Created on Jan 5, 2025

This example visualizes a system administration workflow that automatically masks or unmasksthe Linux sleep and suspend targets based on active SSH sessions. It shows a shell script that counts established SSH connections on port 22 using `ss` and `awk`, then conditionally runs `systemctl mask` or `systemctl unmask` on `sleep.target` and `suspend.target`. The visualization highlights the script’s branching logic driven by `PAM_TYPE` (open or close session) and the connection count. No external charting library is used; the code relies on standard shell utilities (`ss`, `awk`, `logger`, `sudo`) to manage systemd power management.

AI-generated description

Similar vizzes