diff --git a/scripts/zfs.sh b/scripts/zfs.sh index 9ead0316d9ee..16c7f8b8df4b 100755 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -164,7 +164,7 @@ unload_modules_freebsd() { unload_modules_linux() { NAME="${KMOD_ZFS##*/}" NAME="${NAME%.ko}" - $DELMOD "$NAME" || return + ! [ -d "/sys/module/$NAME" ] || $DELMOD "$NAME" || return if [ "$VERBOSE" = "yes" ]; then echo "Successfully unloaded ZFS module stack"