From 1387000ce678bf0d15951c3a51d9106577976081 Mon Sep 17 00:00:00 2001
From: Tomas Plesnik <plesnik@ics.muni.cz>
Date: Sat, 3 Jan 2015 10:25:27 +0100
Subject: [PATCH] bugfix: smazani vsech binarek z nastaveneho adresare pro
 symlinky; podminky pro spusteni funkce deleteSymlinks presunuty do tela
 funkce; pridan vypis Summary

---
 src/warden-server/sh/uninstall.sh | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/warden-server/sh/uninstall.sh b/src/warden-server/sh/uninstall.sh
index 78b3a09..666e598 100755
--- a/src/warden-server/sh/uninstall.sh
+++ b/src/warden-server/sh/uninstall.sh
@@ -142,12 +142,17 @@ uninstallWardenServer()
 
 deleteSymlinks()
 {
-	echo -n "Deleting symlinks from $symbin ... "
-	for file in "$symbin/"*
-	do
-		rm -f "${symbin}/${file##*/}" 2> /dev/null
-	done
-	echo "OK"
+	echo -n "Checking symbolic links directory $symbin ... "
+	if [[ -d $symbin && -w $symbin ]]; then
+		echo "OK"
+		for file in "$bin/"*
+		do
+			echo "- removing symlink: ${symbin}/${file##*/} -> $file"
+			rm -f "${symbin}/${file##*/}" 2> /dev/null
+		done
+	else
+		echo "FAILED!"
+	fi
 }
 
 
@@ -181,7 +186,7 @@ backup="/tmp/warden-backup"
 
 echo "Uninstallation of Warden server package ..."
 echo
-echo "------------------------- Uninstallation process --------------------------------"
+echo "------------------------- Uninstallation process ------------------------"
 
 # check Warden server directory if exists
 wardenDirChck
@@ -196,7 +201,10 @@ createBackup
 uninstallWardenServer || exit 1
 
 # delete symlinks from $symbin (if -s option is set)
-[[ ! -z "$symbin" ]] && [[ -d "$symbin" ]] && [[ -w "$symbin" ]] && deleteSymlinks
+[[ ! -z "$symbin" ]] && deleteSymlinks
+
+echo
+echo "------------------------- Summary ---------------------------------------"
 
 echo
 echo "Please follow post-uninstallation steps in ${uninstall}."
-- 
GitLab