Skip to content
Snippets Groups Projects
Commit 519c8e30 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

presun funkce removeSymlinks; pridano odstraneni koncoveho lomitka z adresare symbolickych odkazu

parent 56f5cee3
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,22 @@ createBackup()
}
removeSymlinks()
{
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
}
uninstallWardenServer()
{
echo -n "Uninstalling $package_version package ... "
......@@ -140,22 +156,6 @@ uninstallWardenServer()
}
removeSymlinks()
{
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
}
#-------------------------------------------------------------------------------
# MAIN
#-------------------------------------------------------------------------------
......@@ -172,6 +172,7 @@ done
# remove last char (slash) from name of directories
[[ "$basedir" == */ ]] && basedir="${basedir%?}"
[[ "$symbin" == */ ]] && symbin="${symbin%?}"
# params test
paramsChck
......@@ -197,11 +198,12 @@ getPackageVersion
# make backup of currently installed warden-server package
createBackup
# remove symlinks from $symbin (if -s option is set)
[[ ! -z "$symbin" ]] && removeSymlinks
# uninstall Warden server
uninstallWardenServer || exit 1
# remove symlinks from $symbin (if -s option is set)
[[ ! -z "$symbin" ]] && removeSymlinks
echo
echo "------------------------- Summary ---------------------------------------"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment