Skip to main content

Remote computer awake (rawake)

Project description

Remote Computer Awake (rawake)

Installation

$ uv pip install -U rawake # install latest version
$ rawake --version # verify installation

Configuration

The rawake configuration is a python-base configuration file. Configuration should be stored at ~/.config/rawake/config.py

Example:

from rawake.config import Config, Computer

DEFAULT_SSH_SUSPEND_COMMAND = "sudo systemctl suspend"

CONFIGURATION = Config(
    computers=[
        Computer(
            name="remote-server",
            ip_address="192.168.0.10",
            mac_address="22:1b:5c:44:12:6b",
            ssh_port=2222,
            ssh_suspend_command=DEFAULT_SSH_SUSPEND_COMMAND,
        ),
        Computer(
            name="other-server",
            ip_address="192.168.0.200",
            mac_address="a4:44:c3:61:10:b8",
            ssh_suspend_command="sudo shutdown -h now",
        ),
    ],
)

Listing the configuration

$ rawake --list
[
  {
    "name": "other-server",
    "mac_address": "a4:44:c3:61:10:b8",
    "ip_address": "192.168.0.200",
    "ss_suspend_command": "sudo shutdown -h now",
    "ssh_port": 22
  },
  {
    "name": "remote-server",
    "mac_address": "22:1b:5c:44:12:6b",
    "ip_address": "192.168.0.10",
    "ss_suspend_command": "sudo systemctl suspend",
    "ssh_port": 2222
  }
]

Suspend remote computer:

rawake requires a username:password SSH connection to the remote host to be able to execute the configured suspend command.

$ rawake --suspend remote-server
SSH authentication:
username:username
password:<password>

Awake remote computer:

For awaking a remote computer, rawake sends a Wake-On-Lan magic packet.

rawake --awake remote-server

Development

Python dev environment:

  • Install uv.

  • Create virtual environment and install dependencies:

    uv sync --all-extras
    
  • Activate the virtualenv:

    source .venv/bin/activate
    
  • Install git pre-commit hooks

    • pre-commit install
    • pre-commit autoupdate

Running the tests:

uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rawake-0.2.1.tar.gz (67.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rawake-0.2.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file rawake-0.2.1.tar.gz.

File metadata

  • Download URL: rawake-0.2.1.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rawake-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c19bb18c106c1f975d280c14044314ef2116ff6ae7f9d1b089321cb56565fab7
MD5 e34a0640c6bc1c6e121df6538f98fae3
BLAKE2b-256 427ce6c36acfc08c06c6850be9a25eec5b3637d2e283e7842bbb1428ca608a59

See more details on using hashes here.

Provenance

The following attestation bundles were made for rawake-0.2.1.tar.gz:

Publisher: release.yml on jfsanchez91/rawake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rawake-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: rawake-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rawake-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a8ec3b31b6c0ae18ef7435ae499c145df0fd6a5f28d3a53bf00a8b4fd8bcb49
MD5 da170d24c1c62cc749d635a6de061da6
BLAKE2b-256 86662fb369acbe8be93f04f460e72137fe4490fbe0e5efb1c438466b562a8543

See more details on using hashes here.

Provenance

The following attestation bundles were made for rawake-0.2.1-py3-none-any.whl:

Publisher: release.yml on jfsanchez91/rawake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page