#!/bin/bash

set -e

if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
  if [ -x /etc/mateconf/mateconf.xml.defaults ]; then
    # Disable automatic window opening on mount
    mateconftool-2 --direct --config-source=xml:readwrite:/etc/mateconf/mateconf.xml.defaults \
    -s "/apps/caja/preferences/media_automount_open" --type bool "true"
  fi
  # Remove debian-installer-launcher.list file
  rm -f /var/lib/dpkg/info/debian-installer-launcher.list
fi
