Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

jitsi-meet-tokens.postrm 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/sh
  2. # postrm script for jitsi-meet-tokens
  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. db_get jitsi-meet-prosody/prosody_config
  23. PROSODY_HOST_CONFIG=$RET
  24. if [ -f "$PROSODY_HOST_CONFIG" ] ; then
  25. db_get jitsi-meet-tokens/appid
  26. APP_ID=$RET
  27. db_get jitsi-meet-tokens/appsecret
  28. APP_SECRET=$RET
  29. # Revert prosody config
  30. sed -i 's/plugin_paths/--plugin_paths/g' $PROSODY_HOST_CONFIG
  31. sed -i 's/authentication = "token"/authentication = "anonymous"/g' $PROSODY_HOST_CONFIG
  32. sed -i 's/ allow_unencrypted_plain_auth/ --allow_unencrypted_plain_auth/g' $PROSODY_HOST_CONFIG
  33. sed -i "s/ app_id=$APP_ID/ --app_id=example_app_id/g" $PROSODY_HOST_CONFIG
  34. sed -i "s/ app_secret=$APP_SECRET/ --app_secret=example_app_secret/g" $PROSODY_HOST_CONFIG
  35. sed -i 's/ modules_enabled = { "token_verification" }/ --modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
  36. JICOFO_CONFIG="/etc/jitsi/jicofo/sip-communicator.properties"
  37. if [ -f "$JICOFO_CONFIG" ] ; then
  38. if grep -q "org.jitsi.jicofo.auth.jwt.APP_ID" $JICOFO_CONFIG || \
  39. grep -q "org.jitsi.jicofo.auth.jwt.APP_SECRET" $JICOFO_CONFIG; then
  40. sed -i.old "/org.jitsi.jicofo.auth.jwt.APP_ID=$APP_ID/d" $JICOFO_CONFIG
  41. sed -i.old "/org.jitsi.jicofo.auth.jwt.APP_SECRET=$APP_SECRET/d" $JICOFO_CONFIG
  42. rm "$JICOFO_CONFIG.old"
  43. # Restart Jicofo
  44. if [ -x "/etc/init.d/jicofo" ]; then
  45. invoke-rc.d jicofo restart
  46. fi
  47. fi
  48. fi
  49. if [ -x "/etc/init.d/prosody" ]; then
  50. invoke-rc.d prosody reload
  51. fi
  52. fi
  53. db_stop
  54. ;;
  55. purge)
  56. ;;
  57. upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
  58. ;;
  59. *)
  60. echo "postrm called with unknown argument \`$1'" >&2
  61. exit 1
  62. ;;
  63. esac
  64. # dh_installdeb will replace this with shell code automatically
  65. # generated by other debhelper scripts.
  66. #DEBHELPER#
  67. db_stop
  68. exit 0