Never Accidentally Power Off Remote Servers Again
SSShutdown abstracts system shutdown, rebooting, package updates, and CPU frequency management behind intentional, distinctive commands so you never accidentally shut down a production host.
The Philosophy
Building safe habits through muscle memory reconditioning.
Typing poweroff, shutdown -h now, or reboot into a terminal comes naturally when wrapping up your workday on your local workstation. But if an SSH session to an offsite production cluster is still active in another tmux pane or window, that same muscle memory can bring down critical infrastructure.
SSShutdown, RRReboot, and UUUpdateAndShutdown, running them by mistake on a remote server safely triggers an innocuous command not found error.Command Reference
Every command is streamlined for speed, safety, and operational awareness.
Power & System State
SSShutdown
Unceremoniously powers off the local machine via sudo poweroff.
RRReboot
Unceremoniously reboots the machine via sudo reboot.
sssuspend
Suspends the system to RAM using systemctl suspend.
hhhibernate
Verifies active swap before safely executing systemctl hibernate.
hybrid
Performs hybrid sleep state via systemctl hybrid-sleep.
Package Management & Updates
| Command | Ceremony? | Description |
|---|---|---|
UpdateOnly | Yes | Checks if updated in the past 24 hours. If older, updates all packages. |
UUUpdateAndShutdown | Yes | Runs ceremonial package updates; powers off only if updates succeed. |
MorningUpdate | No (Forces) | Clears update timestamps and forces a full system upgrade. |
FFForceUpdateAndShutdown | No (Forces) | Forces immediate upgrade and powers down on completion. |
mmmirrorUpdater | Reflector | Refreshes, tests, and sorts fastest regional package mirrors. |
CleanRing | Recovery | Universal GPG keyring repair for Arch, Debian/Ubuntu, and Red Hat/Fedora. |
ArchLinuxCleanRing | Alias | Backward-compatible alias pointing to CleanRing. |
CPU & Energy Governors
Performance
Sets CPU governor to performance and clocks all cores to maximum rated frequency.
PowerSave
Locks CPUs to minimum frequency and automatically triggers powertop --auto-tune.
Mid
Limits CPU clocks to 50% max frequency under powersave governor to reduce fan noise.
Low
Caps CPU clocks to 25% max frequency for extreme battery preservation.
The Ceremony
Intelligent caching prevents wasteful daily bandwidth consumption.
Running full repository syncs multiple times a day strains package mirrors and wastes bandwidth. SSShutdown introduces Ceremony: checking marker files in /root/.updated and /var/cache/pacman/ using POSIX timestamp differentials.
If the system was already upgraded within the threshold interval, SSShutdown gracefully skips the redundant operation and proceeds immediately.
Multi-Distribution Support
Detects system metadata from /etc/os-release and routes to the native package manager.
Arch & Omarchy
Native pacman, reflector, powerpill, and paccache automated cleaning.
Debian & Ubuntu
Non-interactive apt-get with dpkg lock checking, automated autoremove, and reboot alerts.
Red Hat & Fedora
Robust dnf/yum/microdnf upgrades, lock checks, RPM key recovery, and needs-restarting.
openSUSE
Reliable zypper -n update operations with ceremony caching.
NixOS
Native integration with Nix auto updates (nx auto -f).
Lifecycle Hooks
Universal pre/post execution hooks via /etc/ssshutdown/hooks/in and out across all distros.
Installation
Get up and running in seconds on any Linux distribution.
Automated One-Liner
Traditional Makefile
Custom Target Prefix
Nix Flake
Environment Variables
Configure behavior dynamically without modifying files.
| Variable | Default | Purpose |
|---|---|---|
REFLECTOR_COUNTRY | US | Country code passed to reflector for mirror filtering on Arch. |
APT_UPGRADE_TYPE | upgrade | Debian upgrade mode (upgrade or dist-upgrade). |
REDHAT_PKG_MGR | Auto | Override package manager on Red Hat systems (dnf, yum, microdnf). |
SYSTEM_UPDATE_INTERVAL | 1 | Number of days before performing a ceremony update. |
MIRROR_UPDATE_INTERVAL | 7 | Days between mirror ranking cycles. |
SYSTEM_CLEARCACHE_INTERVAL | 30 | Days between running cache cleanup (paccache, apt autoremove, dnf clean). |
PACMAN_LOOPER | true | Retries update loop up to 10 times if keyrings require refresh. |
USE_POWERPILL | false | Accelerates downloads using parallel segmented powerpill. |
DEBUG | false | Enables set -x debugging output across all scripts. |