generic() {
    echo " > Running depmod now..."
    depmod -a
}

unload() {
    lsmod | grep alx > /dev/null
    if [ "$?" = "0" ]; then
        rmmod alx
    fi
}

post_install() {
    generic
    echo " > Reloading alx module..."
    echo "   Please note that you may REBOOT your system to get it works!"
    unload
    sleep 0.5
    modprobe alx
}

post_upgrade() {
    post_install
}

post_remove() {
    generic
    echo " > Unloading memory resident module..."
    unload
    rmmod compat
    echo "  Module unloaded!."
}