X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=lib%2Ffunctions;h=25803f6557872a00e4f4d30de2f2228a28760150;hb=9bd3fb3ab4feccd2936438b56b996dcd75e2e687;hp=012f59c1faab52b55a7034023bb555162202fce4;hpb=4404a269deb7ef3202edfe76ce89af0fb81c5bf2;p=rc-scripts.git diff --git a/lib/functions b/lib/functions index 012f59c..25803f6 100644 --- a/lib/functions +++ b/lib/functions @@ -119,11 +119,7 @@ strstr() { # Apply sysctl settings, including files in /etc/sysctl.d apply_sysctl() { - local file - for file in /etc/sysctl.d/*.conf; do - test -f "$file" && sysctl -q -e -p "$file" - done - sysctl -q -e -p /etc/sysctl.conf + sysctl -q -e --system } if is_yes "$FASTRC" || is_yes "$IN_SHUTDOWN"; then @@ -1028,6 +1024,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