From 622d406d5e6bb8884635dc4413aaaedb376e7076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Frohm=C3=BCller?= Date: Mon, 20 Feb 2023 21:24:03 +0100 Subject: [PATCH] Check if DKMS is installed in install.sh and uninstall.sh. --- install.sh | 6 ++++++ uninstall.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/install.sh b/install.sh index 87631b6..3c4bc04 100755 --- a/install.sh +++ b/install.sh @@ -47,6 +47,12 @@ else echo "Install succeeded." fi +if ! command -v dkms >/dev/null; then + echo "WARNING: DKMS is not installed, skipping driver installation." + echo "To use the advanced features of OpenSuperClone you will have to install the driver manually." + exit 0 +fi + VERSION=$(grep -oP '(?<=set\(OSC_DRIVER_VERSION ).*(?=\))' ../CMakeLists.txt) VERSION=$(echo $VERSION | cut -d' ' -f1) echo "Found OSCDriver version $VERSION." diff --git a/uninstall.sh b/uninstall.sh index e08f775..67406a6 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -39,6 +39,12 @@ fi echo "Done uninstalling OpenSuperClone from /usr/..." +if ! command -v dkms >/dev/null; then + echo "WARNING: DKMS is not installed, skipping driver removal." + echo "If the driver was installed manually, it will not be removed." + exit 0 +fi + echo "Uninstalling OSCDriver..." if lsmod | grep -q oscdriver; then