post_install() {
    :
#!/bin/bash

if type update-alternatives 2>/dev/null >&1; then
    # Remove previous link if it doesn't use update-alternatives
    if [ -L '/usr/bin/jlivertool' -a -e '/usr/bin/jlivertool' -a "`readlink '/usr/bin/jlivertool'`" != '/etc/alternatives/jlivertool' ]; then
      rm -f '/usr/bin/jlivertool'
    fi
    update-alternatives --install '/usr/bin/jlivertool' 'jlivertool' '/opt/jlivertool/jlivertool' 100
else
    ln -sf '/opt/jlivertool/jlivertool' '/usr/bin/jlivertool'
fi

# SUID chrome-sandbox for Electron 5+
chmod 4755 '/opt/jlivertool/chrome-sandbox' || true

update-mime-database /usr/share/mime || true
update-desktop-database /usr/share/applications || true

}
post_remove() {
    :
#!/bin/bash

# Delete the link to the binary
if type update-alternatives >/dev/null 2>&1; then
    update-alternatives --remove 'jlivertool' '/usr/bin/jlivertool'
else
    rm -f '/usr/bin/jlivertool'
fi

}
