home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / wpasupplicant.postrm < prev    next >
Encoding:
Text File  |  2007-04-01  |  1.9 KB  |  87 lines

  1. #!/bin/sh -e
  2. # This script can be called in the following ways:
  3. #
  4. # After the package was removed:
  5. #       <postrm> remove
  6. #
  7. # After the package was purged:
  8. #       <postrm> purge
  9. #
  10. # After the package was upgraded:
  11. #       <old-postrm> upgrade <new-version>
  12. # if that fails:
  13. #       <new-postrm> failed-upgrade <old-version>
  14. #
  15. #
  16. # After all of the packages files have been replaced:
  17. #       <postrm> disappear <overwriting-package> <version>
  18. #
  19. #
  20. # If preinst fails during install:
  21. #       <new-postrm> abort-install
  22. #
  23. # If preinst fails during upgrade of removed package:
  24. #       <new-postrm> abort-install <old-version>
  25. #
  26. # If preinst fails during upgrade:
  27. #       <new-postrm> abort-upgrade <old-version>
  28.  
  29. # Undo removal of a no-longer used conffile
  30. undo_rm_conffile()
  31. {
  32.     CONFFILE="$1"
  33.  
  34.     if [ ! -e "$CONFFILE" ]; then
  35.     if [ -e "$CONFFILE".dpkg-bak ]; then
  36.         echo "Restoring modified conffile $CONFFILE"
  37.         mv -f "$CONFFILE".dpkg-bak "$CONFFILE"
  38.         fi
  39.     fi
  40. }
  41.  
  42.  
  43. # Undo removal of init script
  44. undo_rm_init_script()
  45. {
  46.     undo_rm_conffile /etc/default/wpasupplicant
  47.     undo_rm_conffile /etc/init.d/wpasupplicant
  48.     undo_rm_conffile /etc/wpa_supplicant.conf
  49.     undo_rm_conffile /etc/network/if-pre-up.d/wpasupplicant
  50.     undo_rm_conffile /etc/network/if-post-down.d/wpasupplicant
  51. }
  52.  
  53.  
  54. case "$1" in
  55.     remove)
  56.     ;;
  57.  
  58.     purge)
  59.         # Remove logfiles
  60.         rm -f /var/log/wpa_action.log*
  61.     # Remove stale lock file (lockfile absent since 0.5.5-2)
  62.     rm -f /var/lock/wpa_action.*.lock
  63.     ;;
  64.  
  65.     upgrade|failed-upgrade|disappear)
  66.     ;;
  67.  
  68.     abort-install|abort-upgrade)
  69.     if dpkg --compare-versions "$2" lt "0.4.8-1"; then
  70.         undo_rm_init_script
  71.     fi
  72.     ;;
  73.  
  74.     *)
  75.     echo "$0 called with unknown argument \`$1'" 1>&2
  76.     exit 1
  77.     ;;
  78. esac
  79.  
  80. # Automatically added by dh_installinit
  81. if [ "$1" = "purge" ] ; then
  82.     update-rc.d wpa-ifupdown remove >/dev/null || exit $?
  83. fi
  84. # End automatically added section
  85.  
  86. exit 0
  87.