You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jitsi-meet-prosody.postrm 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. # postrm script for jitsi-meet-prosody
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6. # summary of how this script can be called:
  7. # * <postrm> `remove'
  8. # * <postrm> `purge'
  9. # * <old-postrm> `upgrade' <new-version>
  10. # * <new-postrm> `failed-upgrade' <old-version>
  11. # * <new-postrm> `abort-install'
  12. # * <new-postrm> `abort-install' <old-version>
  13. # * <new-postrm> `abort-upgrade' <old-version>
  14. # * <disappearer's-postrm> `disappear' <overwriter>
  15. # <overwriter-version>
  16. # for details, see http://www.debian.org/doc/debian-policy/ or
  17. # the debian-policy package
  18. # Load debconf
  19. . /usr/share/debconf/confmodule
  20. case "$1" in
  21. remove)
  22. if [ -x "/etc/init.d/prosody" ]; then
  23. invoke-rc.d prosody reload || true
  24. fi
  25. ;;
  26. purge)
  27. db_get jitsi-meet-prosody/jvb-hostname
  28. JVB_HOSTNAME=$(echo "$RET" | xargs echo -n)
  29. if [ -n "$RET" ]; then
  30. rm -f /etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua
  31. rm -f /etc/prosody/conf.d/$JVB_HOSTNAME.cfg.lua
  32. JICOFO_AUTH_DOMAIN="auth.$JVB_HOSTNAME"
  33. # clean up generated certificates
  34. rm -f /etc/prosody/certs/$JVB_HOSTNAME.crt
  35. rm -f /etc/prosody/certs/$JVB_HOSTNAME.key
  36. rm -f /etc/prosody/certs/$JICOFO_AUTH_DOMAIN.crt
  37. rm -f /etc/prosody/certs/$JICOFO_AUTH_DOMAIN.key
  38. rm -rf /var/lib/prosody/$JICOFO_AUTH_DOMAIN.*
  39. rm -rf /var/lib/prosody/$JVB_HOSTNAME.*
  40. # clean created users, replace '.' with '%2e', replace '-' with '%2d'
  41. rm -rf /var/lib/prosody/`echo $JICOFO_AUTH_DOMAIN | sed -e "s/\./%2e/g"| sed -e "s/-/%2d/g"`
  42. # clean the prosody cert from the trust store
  43. rm -rf /usr/local/share/ca-certificates/$JICOFO_AUTH_DOMAIN.*
  44. update-ca-certificates -f
  45. fi
  46. # Clear the debconf variable
  47. db_purge
  48. ;;
  49. upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
  50. ;;
  51. *)
  52. echo "postrm called with unknown argument \`$1'" >&2
  53. exit 1
  54. ;;
  55. esac
  56. # dh_installdeb will replace this with shell code automatically
  57. # generated by other debhelper scripts.
  58. #DEBHELPER#
  59. db_stop
  60. exit 0