"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-5079/debian/jitsi-meet-tokens.postrm" (17 Jun 2021, 1959 Bytes) of package /linux/misc/jitsi-meet-5079.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 # postrm script for jitsi-meet-tokens
    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 
   28         db_get jitsi-meet-prosody/prosody_config
   29         PROSODY_HOST_CONFIG=$RET
   30 
   31         if [ -f "$PROSODY_HOST_CONFIG" ] ; then
   32 
   33             db_get jitsi-meet-tokens/appid
   34             APP_ID=$RET
   35 
   36             db_get jitsi-meet-tokens/appsecret
   37             APP_SECRET=$RET
   38 
   39             # Revert prosody config
   40             sed -i 's/authentication = "token"/authentication = "anonymous"/g' $PROSODY_HOST_CONFIG
   41             sed -i "s/ app_id=\"$APP_ID\"/ --app_id=\"example_app_id\"/g" $PROSODY_HOST_CONFIG
   42             sed -i "s/ app_secret=\"$APP_SECRET\"/ --app_secret=\"example_app_secret\"/g" $PROSODY_HOST_CONFIG
   43             sed -i '/^\s*"token_verification"/ s/"token_verification"/-- "token_verification"/' $PROSODY_HOST_CONFIG
   44 
   45             if [ -x "/etc/init.d/prosody" ]; then
   46                 invoke-rc.d prosody restart || true
   47             fi
   48         fi
   49 
   50         db_stop
   51     ;;
   52 
   53     purge)
   54         # Clear the debconf variable
   55         db_purge
   56     ;;
   57 
   58     upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
   59     ;;
   60 
   61     *)
   62         echo "postrm called with unknown argument \`$1'" >&2
   63         exit 1
   64     ;;
   65 esac
   66 
   67 # dh_installdeb will replace this with shell code automatically
   68 # generated by other debhelper scripts.
   69 
   70 #DEBHELPER#
   71 
   72 db_stop
   73 
   74 exit 0