summarylogtreecommitdiffstats
path: root/kured-sentinel
blob: 40b92a310023b33439f725f2216ceda6542e45e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env sh

if [ ! -f /var/lib/pacman/db.lck ]; then
    libs=$(lsof -n +c 0 2> /dev/null | grep 'DEL.*lib' | awk '1 { print $1 ": " $NF }' | sort -u)
    if [[ -n $libs ]]; then
        exit 0
    fi

    if [ ! -d "/lib/modules/$(uname -r)" ]; then
        exit 0
    fi
fi

exit 1