]>
git.proxmox.com Git - mirror_smartmontools-debian.git/blob - os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall
3 echo "Smartmontools package uninstaller:"
5 # check if we are running with root uid
6 if [[ $EUID -ne 0 ]]; then
7 echo " Error: this script must be run as root"
11 # check if package is installed
12 pkgutil
--info com.smartmontools.pkg
> /dev
/null
2>/dev
/null
14 echo " Error: smartmontools package is not installed"
18 # smartmontools pkg could be installed only on system volume, so this should be safe
21 echo " - removing files"
22 for str
in `pkgutil --files com.smartmontools.pkg`
29 echo " - removing empty directories"
30 for str
in `pkgutil --files com.smartmontools.pkg`
34 rmdir -p "$str" 2>/dev
/null
38 echo " - removing package system entry"
39 pkgutil
--forget com.smartmontools.pkg
40 echo "Done, smartmontolls package removed"