#!/bin/bash #Based on lyshie's scripts at https://gist.github.com/lyshie/0c49393076b8b375ca1bd98c28f95fb0 ACTION="$1" case $ACTION in remove) apt-get remove -y scratch-desktop TEST=$( dpkg-query -s scratch-desktop 2> /dev/null| grep Status | cut -d " " -f 4 ) if [ "$TEST" == 'installed' ];then exit 1 fi ;; esac exit 0