Shadows the system
shutdown binary and refuses to run if tmux or screen sessions are alive on the machine.
- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| bin | ||
| README.md | ||
shutdown
Shadows the system shutdown binary and refuses to run if tmux or screen
sessions are alive on the machine.
Installation
tpm install shutdown
Make sure ~/.tpm/bin is prepended to your PATH, otherwise the real
binary wins.
Usage
shutdown now # checks for sessions, then sudo shutdown
shutdown -h +10 # arguments are forwarded as-is
shutdown -c # always forwarded, never blocked
If a tmux or screen session is running:
error: des sessions sont en cours : tmux
0: 3 windows (created Mon Aug 31 10:12:04 2026)
error: détache ou ferme ces sessions avant de relancer shutdown
Notes
- Sessions are detected with
pgrepacross all users, not just yours — a shutdown kills everyone's sessions. shutdown -c(cancel a scheduled shutdown) always goes through, so the guard can never lock you out of cancelling.- The real binary is called with
sudoand an absolute path, so you will be asked for your password. This is intentional (no NOPASSWD): it also prevents accidentally shutting down from a shell history misclick. - Works over interactive SSH sessions.
ssh host "shutdown now"is not supported (no TTY for sudo, and.zshrcis not sourced) — connect first, then run the command.