home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- # Move a conffile without triggering a dpkg question
- mv_conffile() {
- OLDCONFFILE="$1"
- NEWCONFFILE="$2"
-
- if [ -e "$OLDCONFFILE" ]; then
- echo "Preserving user changes to $NEWCONFFILE ..."
- mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
- mv -f "$OLDCONFFILE" "$NEWCONFFILE"
- fi
- }
-
- set -e
- case "$1" in
- configure)
- # remove bluez-sdpd init, if present
- if [ -f /etc/init.d/bluez-sdp ]; then
- /usr/sbin/update-rc.d -f bluez-sdp remove
- echo "To stop seeing this, remove the now redundant /etc/init.d/bluez-sdp script."
- fi
- # remove bluez-pan init, if present
- if [ -f /etc/init.d/bluez-pan ]; then
- /usr/sbin/update-rc.d -f bluez-pan remove
- echo "To stop seeing this, remove the now redundant /etc/init.d/bluez-pan script."
- echo "Also, bluez-pan is now part of bluez-utils. see /etc/default/bluez-utils for"
- echo "more detail."
- fi
-
- if [ -e /etc/init.d/bluez-utils ]; then
- /usr/sbin/update-rc.d -f bluez-utils remove
- # maybe a (medium/low debconf?) notice is best suited here
- fi
-
- mv_conffile "/etc/init.d/bluez-utils" "/etc/init.d/bluetooth"
- mv_conffile "/etc/default/bluez-utils" "/etc/default/bluetooth"
-
-
- # update modules.conf
- /sbin/update-modules >/dev/null 2>&1
-
- # Remove shutdown and reboot links; this init script does not need them.
- if dpkg --compare-versions "$2" lt "3.1-1ubuntu2"; then
- rm -f /etc/rc0.d/K74bluetooth /etc/rc6.d/K74bluetooth
- fi
-
- # use MAKEDEV instead of the original bluez script below as per policy 10.6
- echo "Creating device nodes ..."
- cd /dev && ./MAKEDEV bluetooth
-
- # Create BlueZ devices in /dev
- # Originally by Marcel Holtmann
- # Amended by Edd Dumbill <ejad@debian.org> for
- # the Debian distribution and to support devfs
- #
- # VHCI_MAJOR=10
- # VHCI_MINOR=250
- #
- # RFCOMM_MAJOR=216
- #
- # # if devfs isn't mounted on /dev/ or we're not
- # # using udev, then we need to create the device names
- #
- # if [ ! -e /dev/.devfsd -a ! -e /dev/.udevdb ]; then
- # echo "Checking and creating device nodes ..."
- # #
- # # Create device for VHCI
- # #
- # if [ ! -c /dev/vhci ]; then
- # mknod /dev/vhci c ${VHCI_MAJOR} ${VHCI_MINOR}
- # chmod 660 /dev/vhci
- # fi
- #
- # #
- # # Create devices for RFCOMM
- # #
- # C=0;
- # while [ $C -lt 256 ]; do
- # if [ ! -c /dev/rfcomm$C ]; then
- # mknod -m 660 /dev/rfcomm$C c ${RFCOMM_MAJOR} $C
- # chgrp dialout /dev/rfcomm$C
- # fi
- # C=`expr $C + 1`
- # done
- # fi
- #
- # # handle the devfs case
- # if [ -e /dev/.devfsd ]; then
- # # tell devfs about the new files
- # if [ -x /usr/sbin/update-devfsd ]; then
- # echo "Updating devfsd configuration..."
- # /usr/sbin/update-devfsd >/dev/null
- # else
- # echo "You have devfs enabled but no devfsd. This means that the"
- # echo "RFCOMM device nodes cannot be checked and created if"
- # echo "necessary. To make sure, please install the `devfsd'"
- # echo "package and run `dpkg-reconfigure bluez-utils'."
- # fi
- # fi
-
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 0
- ;;
- esac
-
- # Automatically added by dh_installinit
- if [ -x "/etc/init.d/bluetooth" ]; then
- update-rc.d bluetooth start 25 2 3 4 5 . stop 74 1 . >/dev/null
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d bluetooth start || exit $?
- else
- /etc/init.d/bluetooth start || exit $?
- fi
- fi
- # End automatically added section
-
-