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-tokens.postrm 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/authentication = "token"/authentication = "anonymous"/g' $PROSODY_HOST_CONFIG
  31. sed -i "s/ app_id=\"$APP_ID\"/ --app_id=\"example_app_id\"/g" $PROSODY_HOST_CONFIG
  32. sed -i "s/ app_secret=\"$APP_SECRET\"/ --app_secret=\"example_app_secret\"/g" $PROSODY_HOST_CONFIG
  33. sed -i '/^\s*"token_verification"/ s/"token_verification"/-- "token_verification"/' $PROSODY_HOST_CONFIG
  34. if [ -x "/etc/init.d/prosody" ]; then
  35. invoke-rc.d prosody restart || true
  36. fi
  37. fi
  38. db_stop
  39. ;;
  40. purge)
  41. # Clear the debconf variable
  42. db_purge
  43. ;;
  44. upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
  45. ;;
  46. *)
  47. echo "postrm called with unknown argument \`$1'" >&2
  48. exit 1
  49. ;;
  50. esac
  51. # dh_installdeb will replace this with shell code automatically
  52. # generated by other debhelper scripts.
  53. #DEBHELPER#
  54. db_stop
  55. exit 0