pilc-system.postinst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. # postinst script for pilc-system
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6. # summary of how this script can be called:
  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. # for details, see https://www.debian.org/doc/debian-policy/ or
  16. # the debian-policy package
  17. first()
  18. {
  19. echo "$1"
  20. }
  21. case "$1" in
  22. configure)
  23. systemctl disable regenerate_ssh_host_keys.service
  24. systemctl enable pilc_regenerate_ssh_host_keys.service
  25. systemctl disable ssh.service
  26. if [ -e "$(first /etc/ssh/ssh_host_*_key*)" ]; then
  27. rm /etc/ssh/ssh_host_*_key*
  28. fi
  29. echo 1 > /etc/ssh/sshd_not_to_be_run
  30. systemctl enable pilc_resize_rootfs.service
  31. ;;
  32. abort-upgrade|abort-remove|abort-deconfigure)
  33. ;;
  34. *)
  35. echo "postinst called with unknown argument \`$1'" >&2
  36. exit 1
  37. ;;
  38. esac
  39. # dh_installdeb will replace this with shell code automatically
  40. # generated by other debhelper scripts.
  41. #DEBHELPER#
  42. exit 0