{"id":31826978,"url":"https://github.com/vwkyc/blackoutgrace","last_synced_at":"2026-04-17T10:05:46.046Z","repository":{"id":317421741,"uuid":"921712917","full_name":"vwkyc/blackoutgrace","owner":"vwkyc","description":"graceful shutdown of UPS powered servers.","archived":false,"fork":false,"pushed_at":"2025-09-30T18:28:03.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T20:23:45.194Z","etag":null,"topics":["automation","bash","linux","power-management","server-management","systemd","ups"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vwkyc.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-24T13:26:29.000Z","updated_at":"2025-09-30T18:29:13.000Z","dependencies_parsed_at":"2025-09-30T20:23:47.980Z","dependency_job_id":"66ab1464-9f9a-48f0-b910-e537b7aa269b","html_url":"https://github.com/vwkyc/blackoutgrace","commit_stats":null,"previous_names":["vwkyc/noupspoweroff"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/vwkyc/blackoutgrace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vwkyc%2Fblackoutgrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vwkyc%2Fblackoutgrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vwkyc%2Fblackoutgrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vwkyc%2Fblackoutgrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vwkyc","download_url":"https://codeload.github.com/vwkyc/blackoutgrace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vwkyc%2Fblackoutgrace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008139,"owners_count":26084397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bash","linux","power-management","server-management","systemd","ups"],"created_at":"2025-10-11T17:49:37.826Z","updated_at":"2025-10-11T17:49:42.276Z","avatar_url":"https://github.com/vwkyc.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlackoutGrace\n\n## Overview\n\nBlackoutGrace is a lightweight utility that detects mains power loss from a battery-powered monitoring host and performs graceful shutdowns of remote servers via SSH. It's designed for simple UPS setups without monitoring functionality.\n\nKey features:\n- No extra hardware required\n- Multi-server support via SSH\n- Configurable shutdown delay and battery thresholds\n- Stable-power detection to avoid reacting to short flickers\n\n## Installation\n\nClone the repository and make the script executable:\n\n```bash\ngit clone https://github.com/vwkyc/blackoutgrace.git\ncd blackoutgrace\nchmod +x blackoutgrace.sh\n```\n\n## Deployment\n\n1. Copy files to system locations (adjust usernames as needed):\n\n```bash\nsudo install -m 755 blackoutgrace.sh /usr/local/bin/\nsudo cp blackoutgrace.service /etc/systemd/system/\nsudo cp blackoutgrace.conf /etc/\n```\n\n2. Reload systemd and enable the service:\n\n```bash\nsudo systemctl daemon-reload\nsudo systemctl enable blackoutgrace.service --now\n```\n\n## Configuration\n\nEdit `/etc/blackoutgrace.conf` to set the shutdown delay, battery thresholds, and the target servers (use `[serverN]` sections with `user` and `host` keys).\n\nCore parameters in the `[general]` section include:\n- `minutes`: Shutdown delay on battery power (default: 25)\n- `sleep_interval`: Check frequency in seconds (default: 5)\n- `min_battery`: Critical battery threshold for immediate shutdown (default: 10)\n- `ac_stable_time`: Time AC must remain stable before cancelling shutdown (default: 300)\n\n## Server setup\n\nEnsure the target servers allow passwordless sudo for shutdown commands and that SSH key-based authentication is configured.\n\nAdd to sudoers (via `visudo`) on each target server:\n\n```text\nUSERNAME ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown\n```\n\n## Monitoring \u0026 Logs\n\nView status and logs with systemd/journalctl:\n\n```bash\nsudo systemctl status blackoutgrace.service\njournalctl -u blackoutgrace.service -f\n```\n\n## Uninstallation\n\nTo remove the service and script:\n\n```bash\nsudo systemctl stop blackoutgrace.service\nsudo systemctl disable blackoutgrace.service\nsudo rm /etc/systemd/system/blackoutgrace.service\nsudo rm /usr/local/bin/blackoutgrace.sh\nsudo systemctl daemon-reload\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvwkyc%2Fblackoutgrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvwkyc%2Fblackoutgrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvwkyc%2Fblackoutgrace/lists"}