/pm/sleep.d/10_unattended-upgrades-hibernate

http://github.com/brinkman83/bashrc · Shell · 33 lines · 14 code · 7 blank · 12 comment · 1 complexity · a7b97909d974f309a2ed541d29b261b2 MD5 · raw file

  1. #!/bin/sh
  2. # Action script ensure that unattended-upgrades is finished
  3. # before a hibernate
  4. #
  5. # Copyright: Copyright (c) 2009 Michael Vogt
  6. # License: GPL-2
  7. #
  8. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  9. if [ ! -x /usr/share/unattended-upgrades/unattended-upgrade-shutdown ]; then
  10. exit 0
  11. fi
  12. SELF=unattended-upgrades-hibernate
  13. COMMAND=
  14. IFPLUGD_IFACE=
  15. # pm-action(8) - <action> <suspend method>
  16. #
  17. # On suspend|hibernate, disconnect any wpa-roam managed interfaces,
  18. # reconnect it on resume.
  19. case "${1}" in
  20. hibernate)
  21. python /usr/share/unattended-upgrades/unattended-upgrade-shutdown
  22. ;;
  23. resume|thaw)
  24. # nothing
  25. ;;
  26. esac