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