Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

A little script that exposes an API for power management over the network

License

Notifications You must be signed in to change notification settings

danieldirks/network-shutdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

network-shutdown

A little script that exposes an API for power management over the network

MIT License

WARNING: Do NOT use this in insecure or publicly available networks. There is currently no authentication mechanism to prevent unauthorized access.

Installation

Clone the repository, create a virtual environment in the directory .venv and install all dependencies:

git clone https://github.com/danieldirks/network-shutdown.git
cd network-shutdown
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate

If you want to use an other name for the virtual environment or want to use the system interpreter (which I would not recommend), you need to change the references in start.sh.

You can now create an autostart job for start.sh to run the server on every startup.

Configuration

The config.ini contains all configuration keys and is mostly self-explaining. It currently uses systemctl for power management to allow running without privileges.

The default port for the API is 48080.

Features

I wrote the script to let my smart home system shutdown my computer.

The script exposes a REST API with flask-restful which allows the following requests:

License

The project is licensed under the MIT License.

About

A little script that exposes an API for power management over the network

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published