preinst revision 98b57301cf15ff5f95eaf7bc8b81e57750026b8e
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#!/bin/bash -e
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync. /usr/share/debconf/confmodule
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncdb_version 2.0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncdb_capb backup
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# check for old vboxdrv modules
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncif find /lib/modules -name vboxdrv\* 2>/dev/null|grep -q vboxdrv; then
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync # old modules found
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync db_get virtualbox-ose/delete-old-modules
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if [ "$RET" = "false" ]; then
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cat << EOF
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncOld vboxdrv kernel modules found in
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncEOF
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync find /lib/modules -name vboxdrv\* 2>/dev/null|sed "s+\(.*\)+ \1+g"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cat << EOF
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRemoving of these modules denied by debconf setting
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncEOF
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync else
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync db_input critical virtualbox-ose/delete-old-modules || true
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync db_go || true
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync db_get virtualbox-ose/delete-old-modules
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if [ "$RET" = "true" ]; then
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync find /lib/modules -name vboxdrv\* 2>/dev/null|xargs rm -f 2>/dev/null
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync fi
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync fi
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncfi
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync