Shadows the system reboot binary and refuses to run if tmux or screen sessions are alive on the machine.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-31 17:40:59 +02:00
bin Initial commit 2026-08-31 17:40:59 +02:00
README.md Initial commit 2026-08-31 17:40:59 +02:00

reboot

Shadows the system reboot binary and refuses to run if tmux or screen sessions are alive on the machine.

Installation

tpm install reboot

Make sure ~/.tpm/bin is prepended to your PATH, otherwise the real binary wins.

Usage

reboot                            # checks for sessions, then sudo reboot

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 reboot

Notes

  • Sessions are detected with pgrep across all users, not just yours — a reboot kills everyone's sessions.
  • The real binary is called with sudo and an absolute path, so you will be asked for your password. This is intentional (no NOPASSWD): it also prevents accidentally rebooting from a shell history misclick.
  • Works over interactive SSH sessions. ssh host reboot is not supported (no TTY for sudo, and .zshrc is not sourced) — connect first, then run the command.