Skip to main content

Shutdown On Lan is a FastAPI application that allows you to remotely shut down the system.

Project description

Shutdown On Lan

Shutdown On Lan is a FastAPI application that allows you to remotely shut down the system.

Why?

  • It's easy to integrate into existing projects like UpSnap (It was created for it!)
  • It simplifies the process of remotely shutting down the PC without requiring complex configurations.

Example Use Case

I use this tool combined with UpSnap for booting my gaming PC, Tailscale as VPN for the remote connection, and Sunshine for streaming so I can connect and play my games even when I'm not at home.

Usage

  1. Download the package:

    pip install shutdown-on-lan
    
  2. Start the application:

    shutdown-on-lan
    
  3. Send an HTTP request to shut down the computer. For example, using curl:

    Replace <IP_ADDRESS> with the IP address of the machine you want to shut down and <PORT> with the port number (default is 8000).

    curl "http://<IP_ADDRESS>:<PORT>/shutdown"
    

Adding the Command to Startup on Windows

To run shutdown-on-lan automatically at startup on Windows without opening a terminal, follow these steps:

  1. Create a batch file:

    • Open a text editor and paste the following content:
      @echo off
      start "" /B pythonw -m shutdown_on_lan.main
      
    • Save the file as shutdown-on-lan.bat.
  2. Create a shortcut:

    • Right-click on your desktop or in a folder and select New > Shortcut.
    • In the location field, enter the path to the shutdown-on-lan.bat file.
    • Click Next and give the shortcut the name shutdown-on-lan.
  3. Move the shortcut to the Startup folder:

    • Press Win + R, type shell:startup, and press Enter.
    • Move the shortcut you created into the Startup folder.

This will run shutdown-on-lan in the background without opening a terminal and add an icon to the system tray. You can quit the application by right-clicking the tray icon and selecting "Quit".

Arguments

Port

You can specify a custom port for the application to run on by using the --port argument. The default port is 8000.

Example:

shutdown-on-lan --port 8080

Message

You can specify a custom shutdown message to be displayed before the system shuts down by using the --message argument. The default message is System will shut down in 5 minutes

Example:

shutdown-on-lan --message "System will shut down in 5 minutes"

Hide Message

You can hide the shutdown message by using the --hide-message argument. By default, the message is shown.

Example:

shutdown-on-lan --hide-message

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

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

shutdown_on_lan-1.0.1.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

shutdown_on_lan-1.0.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file shutdown_on_lan-1.0.1.tar.gz.

File metadata

  • Download URL: shutdown_on_lan-1.0.1.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.5 Windows/11

File hashes

Hashes for shutdown_on_lan-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c874fa99d3370934defb1a2775506a06c0a65e9e081b602fc643af918d61a377
MD5 7f7ddf9a050bdb7962810cd80793b147
BLAKE2b-256 98a34cb878e0e0f55e5b158565332b4d4b8698f06373645abbc2bb71632ee3ea

See more details on using hashes here.

File details

Details for the file shutdown_on_lan-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: shutdown_on_lan-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.5 Windows/11

File hashes

Hashes for shutdown_on_lan-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b29e32c4d120f6f72ca75bb5ed9fc7a2c9f59e29efcb9b5b4f64deab9aaddf5
MD5 f2d7a5c756e7ea5e66a6b611ef79b7e6
BLAKE2b-256 6af81d3263dbad1c9ba86874155f06e8f3455530e0ebe574fe8614b25f5e4c9b

See more details on using hashes here.

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