#!/usr/bin/env bash # # Remove galahad2lcd: stop the service and delete all installed files. # # Usage: sudo ./uninstall.sh set -euo pipefail APP=galahad2lcd BINDIR=/usr/local/bin SYSTEMD_DIR=/etc/systemd/system UDEV_DIR=/etc/udev/rules.d CONFIG_FILE=/etc/galahad2lcd.toml info() { echo -e "\033[0;32m[+] $*\033[0m"; } fail() { echo -e "\033[0;31m[-] $*\033[0m" >&2; exit 1; } [[ $EUID -eq 0 ]] || fail "run as root (sudo $0)" info "stopping and disabling ${APP}" systemctl disable --now "${APP}" 2>/dev/null || true rm -f "${BINDIR}/${APP}" rm -f "${SYSTEMD_DIR}/${APP}.service" rm -f "${UDEV_DIR}/99-${APP}.rules" rm -f "${CONFIG_FILE}" systemctl daemon-reload udevadm control --reload-rules 2>/dev/null || true info "uninstall complete"