home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / var / lib / dpkg / info / bluez-utils.postinst < prev    next >
Encoding:
Text File  |  2006-08-30  |  3.4 KB  |  121 lines

  1. #!/bin/sh
  2.  
  3. # Move a conffile without triggering a dpkg question
  4. mv_conffile() {
  5.     OLDCONFFILE="$1"
  6.     NEWCONFFILE="$2"
  7.  
  8.     if [ -e "$OLDCONFFILE" ]; then
  9.         echo "Preserving user changes to $NEWCONFFILE ..."
  10.         mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
  11.         mv -f "$OLDCONFFILE" "$NEWCONFFILE"
  12.     fi
  13. }
  14.  
  15. set -e
  16. case "$1" in
  17.     configure)
  18.             # remove bluez-sdpd init, if present
  19.         if [ -f /etc/init.d/bluez-sdp ]; then
  20.             /usr/sbin/update-rc.d -f bluez-sdp remove
  21.             echo "To stop seeing this, remove the now redundant /etc/init.d/bluez-sdp script."
  22.         fi
  23.             # remove bluez-pan init, if present
  24.         if [ -f /etc/init.d/bluez-pan ]; then
  25.             /usr/sbin/update-rc.d -f bluez-pan remove
  26.             echo "To stop seeing this, remove the now redundant /etc/init.d/bluez-pan script."
  27.             echo "Also, bluez-pan is now part of bluez-utils. see /etc/default/bluez-utils for"
  28.             echo "more detail."
  29.         fi
  30.  
  31.         if [ -e /etc/init.d/bluez-utils ]; then
  32.             /usr/sbin/update-rc.d -f bluez-utils remove
  33.             # maybe a (medium/low debconf?) notice is best suited here
  34.         fi
  35.        
  36.         mv_conffile "/etc/init.d/bluez-utils" "/etc/init.d/bluetooth"
  37.         mv_conffile "/etc/default/bluez-utils" "/etc/default/bluetooth"
  38.         
  39.  
  40.         # update modules.conf
  41.         /sbin/update-modules >/dev/null 2>&1
  42.  
  43.     # Remove shutdown and reboot links; this init script does not need them.
  44.     if dpkg --compare-versions "$2" lt "3.1-1ubuntu2"; then
  45.         rm -f /etc/rc0.d/K74bluetooth /etc/rc6.d/K74bluetooth
  46.     fi
  47.  
  48.         # use MAKEDEV instead of the original bluez script below as per policy 10.6
  49.         echo "Creating device nodes ..."
  50.         cd /dev && ./MAKEDEV bluetooth
  51.  
  52.         #  Create BlueZ devices in /dev
  53.         #  Originally by Marcel Holtmann
  54.         #  Amended by Edd Dumbill <ejad@debian.org> for
  55.         #  the Debian distribution and to support devfs
  56. #
  57. #        VHCI_MAJOR=10
  58. #        VHCI_MINOR=250
  59. #
  60. #        RFCOMM_MAJOR=216
  61. #
  62. #        # if devfs isn't mounted on /dev/ or we're not
  63. #        # using udev, then we need to create the device names
  64. #
  65. #        if [ ! -e /dev/.devfsd -a ! -e /dev/.udevdb ]; then
  66. #            echo "Checking and creating device nodes ..."
  67. #            #
  68. #            # Create device for VHCI
  69. #            #
  70. #            if [ ! -c /dev/vhci ]; then
  71. #                mknod /dev/vhci c ${VHCI_MAJOR} ${VHCI_MINOR}
  72. #                chmod 660 /dev/vhci
  73. #            fi
  74. #
  75. #            #
  76. #            # Create devices for RFCOMM
  77. #            #
  78. #            C=0;
  79. #            while [ $C -lt 256 ]; do
  80. #                if [ ! -c /dev/rfcomm$C ]; then
  81. #                    mknod -m 660 /dev/rfcomm$C c ${RFCOMM_MAJOR} $C
  82. #                    chgrp dialout /dev/rfcomm$C
  83. #                fi
  84. #                C=`expr $C + 1`
  85. #            done
  86. #        fi
  87. #
  88. #        # handle the devfs case
  89. #        if [ -e /dev/.devfsd ]; then
  90. #            # tell devfs about the new files
  91. #            if [ -x /usr/sbin/update-devfsd ]; then
  92. #                echo "Updating devfsd configuration..."
  93. #                /usr/sbin/update-devfsd >/dev/null
  94. #            else
  95. #                echo "You have devfs enabled but no devfsd. This means that the"
  96. #                echo "RFCOMM device nodes cannot be checked and created if"
  97. #                echo "necessary. To make sure, please install the `devfsd'"
  98. #                echo "package and run `dpkg-reconfigure bluez-utils'."
  99. #            fi
  100. #        fi
  101.  
  102.         ;;
  103.  
  104.     *)
  105.         echo "postinst called with unknown argument \`$1'" >&2
  106.         exit 0
  107.     ;;
  108. esac
  109.  
  110. # Automatically added by dh_installinit
  111. if [ -x "/etc/init.d/bluetooth" ]; then
  112.     update-rc.d bluetooth start 25 2 3 4 5 . stop 74 1 . >/dev/null
  113.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  114.         invoke-rc.d bluetooth start || exit $?
  115.     else
  116.         /etc/init.d/bluetooth start || exit $?
  117.     fi
  118. fi
  119. # End automatically added section
  120.  
  121.