aboutsummaryrefslogtreecommitdiffstats
path: root/security/dazuko/pkg-deinstall
blob: ca77a9d0b97191d7ec8a026d938e3b8c7f255f5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if [ ! "$2" = "POST-DEINSTALL" ]; then
    MODULENAME=dazuko
    FREEBSDVER=`uname -r | cut -f 1 -d .`

    kldstat -n ${MODULENAME} > /dev/null 2>&1; RESULT=$?
    if [ ${RESULT} -eq 0 ]; then
        kldunload -f -n ${MODULENAME}
    fi

    if [ "${FREEBSDVER}" = "4" ]; then
        rm /modules/${MODULENAME}.ko
    else
        rm /boot/modules/${MODULENAME}.ko       
    fi
    
    if [ -f /boot/modules/linker.hints ]; then
        rm /boot/modules/linker.hints
    fi
    
    if [ -f /boot/loader.conf ]; then
        cat /boot/loader.conf | grep ${MODULENAME} > /dev/null 2>&1; RESULT=$?
            if [ ${RESULT} -eq 0 ]; then
            sed -i '' -e "/^${MODULENAME}_load.*/d" /boot/loader.conf
        fi
    fi
fi
exit 0