summaryrefslogtreecommitdiffstats
path: root/os_darwin/pkg/root/usr/local/sbin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:14:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:14:45 +0000
commit43e8530e93493bb978c446a2023134bdd4277e50 (patch)
treee8c0d3c0c394b17381f48fb2d288f166b4f22440 /os_darwin/pkg/root/usr/local/sbin
parentInitial commit. (diff)
downloadsmartmontools-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-xos_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall40
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"