This project provides a simple way to shutdown a device based on the information provided by the NUT Server. It supports shutting down the device based on the elapsed time and but also when the battery level crosses a certain threshold. Keep in mind it does NOT wake up the device upon power restore.
- Clone this repository
git clone https://github.com/simp16/nutpy-client.git
- Go in to the nutpy-client folder and modify the configuration file according to your needs:
[UPS] NUT_HOST = 192.168.1.1 # nut server host NUT_PORT = 3493 # nut server port NUT_USERNAME = monuser # nut server username NUT_PASSWORD = secret # nut server password SHUTDOWN_TIME = 600 # shutdown 600 seconds after power loss SHUTDOWN_PERCENTAGE = 20 # shutdown after ups battery drops below 20%
- Add execute permission to scripts run the installation with:
sudo chmod +x install uninstall sudo ./install
- Check if the service is running with:
sudo systemctl status nutpy-client.service
You can change the configuration in /etc/nutpy-client/client.conf or by rerunning the installation script. If you modify the script in /etc restart the nutpy-client service with:
sudo systemctl restart nutpy-client.service
Uninstall the client with this code:
sudo ./uninstall