{"id":49606533,"url":"https://github.com/bavix/sol","last_synced_at":"2026-05-04T13:10:06.054Z","repository":{"id":315805674,"uuid":"1060889712","full_name":"bavix/sol","owner":"bavix","description":"Shutdown on LAN - reverse Wake-on-LAN implementation in Go","archived":false,"fork":false,"pushed_at":"2026-04-29T16:50:02.000Z","size":2142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-29T18:15:50.536Z","etag":null,"topics":["shutdown-on-lan","sol","wake-on-lan","wol"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bavix.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-09-20T19:57:02.000Z","updated_at":"2026-04-29T16:50:07.000Z","dependencies_parsed_at":"2025-09-20T21:40:30.906Z","dependency_job_id":null,"html_url":"https://github.com/bavix/sol","commit_stats":null,"previous_names":["bavix/sol"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bavix/sol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bavix%2Fsol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bavix%2Fsol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bavix%2Fsol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bavix%2Fsol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bavix","download_url":"https://codeload.github.com/bavix/sol/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bavix%2Fsol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32608446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["shutdown-on-lan","sol","wake-on-lan","wol"],"created_at":"2026-05-04T13:10:05.282Z","updated_at":"2026-05-04T13:10:06.044Z","avatar_url":"https://github.com/bavix.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SoL - Shutdown on LAN\n\nSoL is a service that listens for Wake-on-LAN magic packets and triggers power actions (shutdown or reboot) when received.\n\n## Inspiration\n\nThis project was inspired by the article [\"Выключаем компьютер через Wake-on-Lan\"](https://habr.com/ru/articles/816765/) on Habr, which demonstrates how to repurpose Wake-on-LAN packets for shutdown functionality instead of wake-up.\n\n## Description\n\nThe sol service is built using [cobra](https://github.com/spf13/cobra) CLI framework and Go standard library.\n\n### Listen\n\nThe listen command listens for Wake-on-LAN magic packets on the specified network interface and triggers a power action when a matching packet is received.\n\n### Protocol\n\nThe service listens for Wake-on-LAN magic packets on UDP ports. When a magic packet containing the target MAC address is received, the configured power action is executed.\n\n### Supported Actions\n\n- **shutdown** — shut down the system (`shutdown -h now` on Linux/macOS, `shutdown -s -t 0 -f` on Windows)\n- **reboot** — restart the system (`shutdown -r now` on Linux/macOS, `shutdown -r -t 0 -f` on Windows)\n\n## Run the service\n\n### Simple mode\n\n```bash\nsol listen --iface eth0 --port 9\n```\n\n### Advanced mode (multiple ports)\n\nListen on multiple ports with different actions:\n\n```bash\nsol listen --iface eth0 --port 9 --port 8:reboot\n```\n\n### Options\n\n- `--iface`: Network interface name to bind to (required)\n- `--port`: UDP port to listen on, optionally with action (e.g. `9` for shutdown, `8:reboot` for specific action). Can be specified multiple times\n- `--dry-run`: Log when a matching packet is received instead of executing the power action\n\n## Installation\n\n### Quick Install\n\nDownload the latest release for your platform and architecture:\n\n**Linux AMD64:**\n```bash\ncurl -L https://github.com/bavix/sol/releases/download/v0.0.2/sol-v0.0.2-linux-amd64.tar.gz | tar -xz \u0026\u0026 sudo mv sol /usr/local/bin/\n```\n\n**Linux ARM64:**\n```bash\ncurl -L https://github.com/bavix/sol/releases/download/v0.0.2/sol-v0.0.2-linux-arm64.tar.gz | tar -xz \u0026\u0026 sudo mv sol /usr/local/bin/\n```\n\n**macOS Intel:**\n```bash\ncurl -L https://github.com/bavix/sol/releases/download/v0.0.2/sol-v0.0.2-darwin-amd64.tar.gz | tar -xz \u0026\u0026 sudo mv sol /usr/local/bin/\n```\n\n**macOS Apple Silicon:**\n```bash\ncurl -L https://github.com/bavix/sol/releases/download/v0.0.2/sol-v0.0.2-darwin-arm64.tar.gz | tar -xz \u0026\u0026 sudo mv sol /usr/local/bin/\n```\n\n**Windows (PowerShell):**\n```powershell\nInvoke-WebRequest -Uri \"https://github.com/bavix/sol/releases/download/v0.0.2/sol-v0.0.2-windows-amd64.zip\" -OutFile \"sol.zip\"\nExpand-Archive -Path \"sol.zip\" -DestinationPath \".\" -Force\nmove sol.exe C:\\Windows\\System32\\sol.exe\n```\n\n### Verify Installation\n```bash\nsol --help\n```\n\n### Systemd Service Setup\n\nTo run SoL as a systemd service that starts automatically:\n\n1. **Create systemd unit file**\n\n   ```bash\n   sudo nano /etc/systemd/system/sol.service\n   ```\n\n   Add the following content:\n\n   ```ini\n   [Unit]\n   Description=SOL listener\n   After=network-online.target\n   Wants=network-online.target\n\n   [Service]\n   ExecStart=/usr/local/bin/sol listen --iface enp2s0 --port 9 --port 8:reboot\n   Restart=always\n   RestartSec=5\n   User=root\n\n   [Install]\n   WantedBy=multi-user.target\n   ```\n\n   **Important**: Replace `enp2s0` with your actual network interface name.\n\n2. **Reload systemd configuration**\n\n   ```bash\n   sudo systemctl daemon-reload\n   ```\n\n3. **Enable autostart**\n\n   ```bash\n   sudo systemctl enable sol.service\n   ```\n\n4. **Start the service**\n\n   ```bash\n   sudo systemctl start sol.service\n   ```\n\n5. **Check service status**\n\n   ```bash\n   sudo systemctl status sol.service\n   ```\n\n6. **View logs**\n\n   ```bash\n   journalctl -u sol.service -f\n   ```\n\n### Service Configuration Notes\n\n- `After=network-online.target` ensures the service starts after the network is fully online\n- `Restart=always` automatically restarts the service if it crashes\n- For production use, remove `--dry-run` flag from the ExecStart command\n- Consider creating a dedicated user instead of running as root for better security\n- When using multiple ports, separate them with multiple `--port` flags\n\n### Security Note\n\nAny device on the same network segment can send Wake-on-LAN magic packets. This means any device that can reach the listening ports can trigger shutdown or reboot. Use firewall rules or network segmentation to restrict access.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbavix%2Fsol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbavix%2Fsol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbavix%2Fsol/lists"}