-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathuninstall.sh
More file actions
37 lines (30 loc) · 1.03 KB
/
uninstall.sh
File metadata and controls
37 lines (30 loc) · 1.03 KB
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
#!/bin/bash
# Get the original username, even if running with sudo
if [ "$SUDO_USER" ]; then
CURRENT_USER=$SUDO_USER
else
CURRENT_USER=$(whoami)
fi
echo "Uninstalling Stremio..."
# Stop and disable the systemd service
if systemctl is-active --quiet stremio.service; then
echo "Stopping Stremio service..."
sudo systemctl stop stremio.service
fi
if systemctl is-enabled --quiet stremio.service; then
echo "Disabling Stremio service..."
sudo systemctl disable stremio.service
fi
# Remove systemd service file
if [ -f /etc/systemd/system/stremio.service ]; then
echo "Removing systemd service file..."
sudo rm /etc/systemd/system/stremio.service
sudo systemctl daemon-reload
fi
# Remove desktop launcher
if [ -f /home/$CURRENT_USER/.local/share/applications/stremio.desktop ]; then
echo "Removing desktop launcher..."
rm /home/$CURRENT_USER/.local/share/applications/stremio.desktop
update-desktop-database /home/$CURRENT_USER/.local/share/applications 2>/dev/null || true
fi
echo "Uninstallation complete!"