forked from NeroReflex/ROGueENEMY
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.sh
47 lines (35 loc) · 1.1 KB
/
uninstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Define variables
INSTALL_DIR="/usr/bin"
SYSTEMD_DIR="/etc/systemd/system"
UDEV_RULES_DIR="/usr/lib/udev/rules.d"
CONFIG_DIR="/etc/ROGueENEMY"
echo "Starting uninstallation of ROGueENEMY..."
# Ensure running as root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root." >&2
exit 1
fi
# Stop and disable the systemd service
echo "Disabling and stopping the systemd service..."
systemctl stop rogue-enemy.service
systemctl disable rogue-enemy.service
rm -f "$SYSTEMD_DIR/rogue-enemy.service"
echo "Enabling handycon..."
systemctl enable --now handycon.service
# Remove the executable
echo "Removing the executable..."
rm -f "$INSTALL_DIR/rogue-enemy"
# Remove udev rules
echo "Removing udev rules..."
rm -f "$UDEV_RULES_DIR/99-disable-sonypad.rules"
rm -f "$UDEV_RULES_DIR/99-rogue.rules"
# Remove configuration directory
echo "Removing configuration directory..."
rm -rf "$CONFIG_DIR"
# Reload system daemons and udev rules
echo "Reloading system daemons and udev rules..."
systemctl daemon-reload
udevadm control --reload-rules
udevadm trigger
echo "Uninstallation complete."