#!/bin/bash

ACTION="$1"

shift
PACKAGE_LIST=$@

case $ACTION in

	remove)
		count=0
		for ix in $PACKAGE_LIST
		do
		if [[ "$ix" == "chromium-snapfree" ]];then
				apt-get -y remove $ix
				TEST=$( dpkg-query -s $ix 2> /dev/null| grep Status | cut -d " " -f 4 )

				if [[ ! -z "$TEST" ]];then
					count+=1
				fi
			fi
		done

		if [ $count -gt 0 ];then
			exit 1
		fi
	;;

esac
exit 0	