diff --git a/src/warden-server/sh/uninstall.sh b/src/warden-server/sh/uninstall.sh index 78b3a09a2eb69b249a482f19e6b95431fdcea46b..666e5980a2fceb16e0becfa7f93561db97a89b51 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}."