diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:14:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:14:45 +0000 |
commit | 43e8530e93493bb978c446a2023134bdd4277e50 (patch) | |
tree | e8c0d3c0c394b17381f48fb2d288f166b4f22440 /os_darwin/pkg/root/usr/local/sbin | |
parent | Initial commit. (diff) | |
download | smartmontools-43e8530e93493bb978c446a2023134bdd4277e50.tar.xz smartmontools-43e8530e93493bb978c446a2023134bdd4277e50.zip |
Adding upstream version 7.4.upstream/7.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'os_darwin/pkg/root/usr/local/sbin')
-rwxr-xr-x | os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall b/os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall new file mode 100755 index 0000000..72bb3fa --- /dev/null +++ b/os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall @@ -0,0 +1,40 @@ +#!/bin/sh + +echo "Smartmontools package uninstaller:" + +# check if we are running with root uid +if [[ $EUID -ne 0 ]]; then + echo " Error: this script must be run as root" + exit 1 +fi + +# check if package is installed +pkgutil --info com.smartmontools.pkg > /dev/null 2>/dev/null +if [ $? -ne 0 ]; then + echo " Error: smartmontools package is not installed" + exit 1 +fi + +# smartmontools pkg could be installed only on system volume, so this should be safe +cd / + +echo " - removing files" +for str in `pkgutil --files com.smartmontools.pkg` +do + if [ -f "$str" ] + then + rm -f "$str" + fi +done +echo " - removing empty directories" +for str in `pkgutil --files com.smartmontools.pkg` +do + if [ -d "$str" ] + then + rmdir -p "$str" 2>/dev/null + fi +done + +echo " - removing package system entry" +pkgutil --forget com.smartmontools.pkg +echo "Done, smartmontolls package removed" |