]> TLD Linux GIT Repositories - rc-scripts.git/blobdiff - lib/functions
- PLD merge: container related fixes
[rc-scripts.git] / lib / functions
index 012f59c1faab52b55a7034023bb555162202fce4..682102201880e77143688e76525a20b29453c69b 100644 (file)
@@ -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