qubes-core-agent-network-manager.postinst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. # postinst script for core-agent-linux
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6. # The postinst script may be called in the following ways:
  7. # * <postinst> 'configure' <most-recently-configured-version>
  8. # * <old-postinst> 'abort-upgrade' <new version>
  9. # * <conflictor's-postinst> 'abort-remove' 'in-favour' <package>
  10. # <new-version>
  11. # * <postinst> 'abort-remove'
  12. # * <deconfigured's-postinst> 'abort-deconfigure' 'in-favour'
  13. # <failed-install-package> <version> 'removing'
  14. # <conflicting-package> <version>
  15. #
  16. # For details, see http://www.debian.org/doc/debian-policy/ or
  17. # https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html or
  18. # the debian-policy package
  19. case "${1}" in
  20. configure)
  21. # Initial installation of package only
  22. # ($2 contains version number on update; nothing on initial installation)
  23. if [ -z "${2}" ]; then
  24. # Create NetworkManager configuration if we do not have it
  25. if ! [ -e /etc/NetworkManager/NetworkManager.conf ]; then
  26. echo '[main]' > /etc/NetworkManager/NetworkManager.conf
  27. echo 'plugins = keyfile' >> /etc/NetworkManager/NetworkManager.conf
  28. echo '[keyfile]' >> /etc/NetworkManager/NetworkManager.conf
  29. fi
  30. /usr/lib/qubes/qubes-fix-nm-conf.sh
  31. fi
  32. ;;
  33. abort-upgrade|abort-remove|abort-deconfigure)
  34. exit 0
  35. ;;
  36. *)
  37. echo "postinst called with unknown argument \`${1}'" >&2
  38. exit 1
  39. ;;
  40. esac
  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 :