This builds on the patch that Martin submitted, but instead of using find to locate the file, we actually use modprobe to test if there's a loadable module.

---
 debian/open-vm-tools.init |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/debian/open-vm-tools.init b/debian/open-vm-tools.init
index 1b2f7f8..c1dc31f 100644
--- a/debian/open-vm-tools.init
+++ b/debian/open-vm-tools.init
@@ -31,8 +31,12 @@ vmxnet_needed ()
                fi
        done

-       if [ -n "$(find /lib/modules/$(uname -r)/ -name vmxnet.ko)" ]
-       then
+       return 1
+}
+
+vmxnet_found ()
+{
+       if modprobe -n -q vmxnet; then
                return 0
        fi

@@ -58,7 +62,7 @@ case "${1}" in
                log_progress_msg "vmsync"; modprobe vmsync
                log_end_msg 0

-               if vmxnet_needed
+               if vmxnet_found && vmxnet_needed
                then
                        modprobe -r pcnet32
                        modprobe vmxnet
@@ -82,7 +86,7 @@ case "${1}" in

                log_end_msg 0

-               if vmxnet_needed
+               if vmxnet_found && vmxnet_needed
                then
                        modprobe -r vmxnet
                        modprobe pcnet32
-- 1.5.6.5




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to