sbin — Support Scripts
install-service.sh
Generates a systemd user-level service file and enables it. No root required.
Prerequisites: The app's .venv must exist and have Flask installed.
bash sbin/install-service.sh
You will be prompted for a host (default 127.0.0.1) and port (default 5000).
The script writes ~/.config/systemd/user/battery-tracker.service and enables it.
Start the service:
systemctl --user start battery-tracker
systemctl --user status battery-tracker
View live logs:
journalctl --user -u battery-tracker -f
Make it start on login (requires lingering to be enabled for your user):
loginctl enable-linger "$USER"
Uninstall:
systemctl --user disable --now battery-tracker
rm ~/.config/systemd/user/battery-tracker.service
systemctl --user daemon-reload
Re-run to update (e.g. if you moved the app directory):
bash sbin/install-service.sh
systemctl --user restart battery-tracker