X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=lib%2Ffunctions;fp=lib%2Ffunctions;h=682102201880e77143688e76525a20b29453c69b;hb=196499bef27e2a6e7b4f321ed9886f550550044c;hp=012f59c1faab52b55a7034023bb555162202fce4;hpb=9688f03ab823fc09f097de03b48bcbd46b7db6ff;p=rc-scripts.git diff --git a/lib/functions b/lib/functions index 012f59c..6821022 100644 --- a/lib/functions +++ b/lib/functions @@ -1028,6 +1028,9 @@ confirm() { # module is needed (ie. is requested, is available and isn't loaded already) is_module() { + # fail if /sbin/lsmod does not exists (ex. in containers) + [ -x /sbin/lsmod ] || return 1 + # module name without .o at end if ! lsmod | grep -q "$1"; then if ls -1R /lib/modules/$(uname -r)/ 2> /dev/null | grep -q "^${1}.\(\|k\)o\(\|.gz\)"; then