#!/bin/bash ACTION="$1" PKG="$2" case $ACTION in remove) echo "Stopping dropbox..." dropbox stop dropboxd sleep 10 if [ $? -eq 0 ];then apt-get remove -y dropbox TEST=$( dpkg-query -s dropbox 2> /dev/null| grep Status | cut -d " " -f 4 ) if [ "$TEST" == 'installed' ];then exit 1 fi else exit 1 fi ;; esac exit 0