mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-27 06:10:36 +00:00
Add uninstall command and tool
Invoke as 'make uninstall' in CMake build directory or run as tools/uninstall Fixes #590
This commit is contained in:
parent
5756f64a2e
commit
7df5cc8042
@ -113,3 +113,7 @@ InstallSymlink(/Volumes/SystemRoot/usr/lib64 ${CMAKE_INSTALL_PREFIX}/libexec/dar
|
||||
InstallSymlink(/Volumes/SystemRoot/usr/share/zoneinfo ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/zoneinfo)
|
||||
|
||||
install(CODE "execute_process(COMMAND bash ${DARLING_TOP_DIRECTORY}/tools/shutdown-user.sh)")
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/uninstall
|
||||
COMMENT "Uninstall Darling and kernel module")
|
||||
|
22
tools/uninstall
Executable file
22
tools/uninstall
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
set +e
|
||||
|
||||
if [ "$(whoami)" != "root" ]
|
||||
then
|
||||
echo "Uninstall must be run as root, invoking sudo"
|
||||
sudo su -c "$0"
|
||||
exit
|
||||
fi
|
||||
|
||||
if command -v darling
|
||||
then
|
||||
darling shutdown
|
||||
fi
|
||||
if [ -d /usr/local/libexec ]
|
||||
then
|
||||
rm -rf /usr/local/libexec/darling
|
||||
rmdir --ignore-fail-on-non-empty /usr/local/libexec
|
||||
fi
|
||||
rm -f /usr/local/bin/darling
|
||||
find /lib/modules -name darling-mach.ko -delete
|
||||
echo "Uninstall complete"
|
Loading…
Reference in New Issue
Block a user