summaryrefslogtreecommitdiff
path: root/omnibus/package-scripts/chef-fips/postrm
diff options
context:
space:
mode:
Diffstat (limited to 'omnibus/package-scripts/chef-fips/postrm')
-rwxr-xr-xomnibus/package-scripts/chef-fips/postrm14
1 files changed, 11 insertions, 3 deletions
diff --git a/omnibus/package-scripts/chef-fips/postrm b/omnibus/package-scripts/chef-fips/postrm
index 247688074e..7789e7f221 100755
--- a/omnibus/package-scripts/chef-fips/postrm
+++ b/omnibus/package-scripts/chef-fips/postrm
@@ -11,11 +11,19 @@ is_smartos() {
uname -v | grep "^joyent" 2>&1 >/dev/null
}
-is_darwin()
-{
+is_darwin() {
uname -v | grep "^Darwin" 2>&1 >/dev/null
}
+is_suse() {
+ if [ -f /etc/os-release ]; then
+ source /etc/os-release
+ [ $ID_LIKE == "sles" ] || [ $ID_LIKE == "suse" ]
+ else
+ [ -f /etc/SuSE-release ]
+ fi
+}
+
if is_smartos; then
PREFIX="/opt/local"
elif is_darwin; then
@@ -33,7 +41,7 @@ cleanup_symlinks() {
# Clean up binary symlinks if they exist
# see: http://tickets.opscode.com/browse/CHEF-3022
-if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! -f /etc/SuSE-release ]; then
+if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! is_suse ]; then
# not a redhat-ish RPM-based system
cleanup_symlinks
elif [ "x$1" = "x0" ]; then