get rid of else in updatexo function

This commit is contained in:
ronivay
2021-05-03 14:23:52 +03:00
parent b290a5335b
commit a872b79483

View File

@@ -737,7 +737,10 @@ function UpdateXO {
set -euo pipefail
if [[ "$PRESERVE" != "0" ]]; then
if [[ "$PRESERVE" == "0" ]]; then
printinfo "PRESERVE variable is set to 0. This needs to be at least 1. Not doing a cleanup"
return 0
fi
# remove old builds. leave as many as defined in PRESERVE variable
echo
@@ -745,9 +748,6 @@ function UpdateXO {
cmdlog "find $INSTALLDIR/xo-builds/ -maxdepth 1 -type d -name \"xen-orchestra*\" -printf \"%T@ %p\\n\" | sort -n | cut -d' ' -f2- | head -n -$PRESERVE | xargs -r rm -r"
find $INSTALLDIR/xo-builds/ -maxdepth 1 -type d -name "xen-orchestra*" -printf "%T@ %p\n" | sort -n | cut -d' ' -f2- | head -n -$PRESERVE | xargs -r rm -r >>$LOGFILE 2>&1
printok "Removing old installations. Leaving $PRESERVE latest"
else
printinfo "PRESERVE variable is set to 0. This needs to be at least 1. Not doing a cleanup"
fi
}