qubes-core-agent-passwordless-root.postrm 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. # postrm script for core-agent-linux
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6. # The prerm script may be called in the following ways:
  7. # * <postrm> 'remove'
  8. # * <postrm> 'purge'
  9. # * <old-postrm> 'upgrade' <new-version>
  10. # * <disappearer's-postrm> 'disappear' <overwriter> <overwriter-version>
  11. #
  12. # The postrm script is called after the package's files have been removed
  13. # or replaced. The package whose postrm is being called may have previously been
  14. # deconfigured and only be "Unpacked", at which point subsequent package changes
  15. # do not consider its dependencies. Therefore, all postrm actions may only rely
  16. # on essential packages and must gracefully skip any actions that require the
  17. # package's dependencies if those dependencies are unavailable.[48]
  18. #
  19. # * <new-postrm> 'failed-upgrade' <old-version>
  20. #
  21. # Called when the old postrm upgrade action fails. The new package will be
  22. # unpacked, but only essential packages and pre-dependencies can be relied on.
  23. # Pre-dependencies will either be configured or will be "Unpacked" or
  24. # "Half-Configured" but previously had been configured and was never removed.
  25. #
  26. # * <new-postrm> 'abort-install'
  27. # * <new-postrm> 'abort-install' <old-version>
  28. # * <new-postrm> 'abort-upgrade' <old-version>
  29. #
  30. # Called before unpacking the new package as part of the error handling of
  31. # preinst failures. May assume the same state as preinst can assume.
  32. #
  33. # For details, see http://www.debian.org/doc/debian-policy/ or
  34. # https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html or
  35. # the debian-policy package
  36. if [ "${1}" = "remove" ] ; then
  37. if [ "$(passwd -S root|cut -f 2 -d ' ')" = "NP" ]; then
  38. passwd --lock root
  39. fi
  40. fi
  41. # dh_installdeb will replace this with shell code automatically
  42. # generated by other debhelper scripts.
  43. #DEBHELPER#
  44. exit 0
  45. # vim: set ts=4 sw=4 sts=4 et :