mirror of
https://github.com/darlinghq/darling.git
synced 2025-03-01 14:16:31 +00:00

* Auto-Calculate Darling Prefix in tools/uninstall Also switched the shebang to ```/bin/sh``` since the script seemed ```sh``` compatible, and there are faster ```sh``` implementations than ```bash``` like ```dash```. * Improve Readability
25 lines
505 B
Bash
Executable File
25 lines
505 B
Bash
Executable File
#!/bin/sh
|
|
set +e
|
|
|
|
if [ "$(whoami)" != "root" ]
|
|
then
|
|
echo "Uninstall must be run as root, invoking sudo"
|
|
sudo su -c "$0"
|
|
exit
|
|
fi
|
|
|
|
INSTALL_PREFIX="$(dirname "$(dirname "$(which darling)")")"
|
|
|
|
if command -v darling
|
|
then
|
|
darling shutdown
|
|
fi
|
|
if [ -d "${INSTALL_PREFIX}/libexec" ]
|
|
then
|
|
rm -rf "${INSTALL_PREFIX}/libexec/darling"
|
|
rmdir --ignore-fail-on-non-empty "${INSTALL_PREFIX}/libexec"
|
|
fi
|
|
rm -f "${INSTALL_PREFIX}/bin/darling"
|
|
find /lib/modules -name darling-mach.ko -delete
|
|
echo "Uninstall complete"
|