#!/bin/bash
SERVICE_NAME="esn-holter"
SERVICE_DIR="$HOME/.config/systemd/user"
SERVICE_FILE="$SERVICE_DIR/$SERVICE_NAME.service"
RULES_PATH="/etc/udev/rules.d/myftdi.rules"

systemctl --user stop "$SERVICE_NAME.service"
systemctl --user disable "$SERVICE_NAME.service"
rm -f "$SERVICE_FILE"
systemctl --user daemon-reload

sudo rm -f "$RULES_PATH"
sudo udevadm control --reload-rules
sudo udevadm trigger

rm -f "/tmp/uninstall_ESNHolter_service.sh"

