-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
41 lines (31 loc) · 958 Bytes
/
Copy pathuninstall.sh
File metadata and controls
41 lines (31 loc) · 958 Bytes
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
#!/bin/sh
# Light Sampler LV2 plugin uninstall script
set -e
PLUGIN_NAME="light_sampler"
echo "Light Sampler LV2 Plugin Uninstall"
echo "=========================="
# Detect installation type
if [ "$(id -u)" -eq 0 ]; then
INSTALL_DIR="/usr/lib/lv2/${PLUGIN_NAME}.lv2"
echo "Uninstalling system-wide version"
else
INSTALL_DIR="${HOME}/.lv2/${PLUGIN_NAME}.lv2"
echo "Uninstalling user version"
fi
# Check if plugin is installed
if [ ! -d "$INSTALL_DIR" ]; then
echo "Error: Plugin not found at $INSTALL_DIR"
exit 1
fi
# Show what will be removed
echo "Removing: $INSTALL_DIR"
# Remove the plugin directory
rm -rf "$INSTALL_DIR"
# Clean up empty parent directory if user installation
if [ "$(id -u)" -ne 0 ] && [ -d "${HOME}/.lv2" ]; then
if [ -z "$(ls -A ${HOME}/.lv2 2>/dev/null)" ]; then
rmdir "${HOME}/.lv2" 2>/dev/null || true
echo "Removed empty ~/.lv2 directory"
fi
fi
echo "Uninstall complete."