dotfiles/dot_bin/executable_lsmod-unloaded

14 lines
339 B
Bash

#! /bin/bash
# list all kernal modules that are not currently loaded
all_mods="$(find /lib/modules/$(uname -r) -type f -name \*.ko -execdir basename {} .ko ';')"
all_mods=${all_mods//-/_}
loaded_mods=$(lsmod | grep -Eo '^[^ ]+')
while read -r line; do
if ! [[ "$loaded_mods" =~ "$line" ]]; then
echo "$line"
fi
done <<< "$all_mods"