#!/bin/bash ACTION="$1" PKG_LIST="smart-notebook smart-product-drivers smart-activation smart-common smart-gallerysetup smart-hwr smart-languagesetup" case $ACTION in remove) apt-get remove -y lliurex-smart64 TEST=$( dpkg-query -s lliurex-smart64 2> /dev/null| grep Status | cut -d " " -f 4 ) if [ "$TEST" == 'installed' ];then exit 1 else for pkg in $PKG_LIST;do apt-get remove -y $pkg TEST=$( dpkg-query -s $pkg 2> /dev/null| grep Status | cut -d " " -f 4 ) if [ "$TEST" == 'installed' ];then exit 1 fi done fi ;; esac exit 0