Don't give error fron find command during rollback if xo-builds directory doesn't exist

This commit is contained in:
ronivay
2020-04-04 20:49:41 +03:00
parent 10cd21067e
commit 26f0bcd858

View File

@@ -563,10 +563,10 @@ function HandleArgs {
function RollBackInstallation { function RollBackInstallation {
INSTALLATIONS=($(find $INSTALLDIR/xo-builds/ -maxdepth 1 -type d -name "xen-orchestra-*")) INSTALLATIONS=($(find $INSTALLDIR/xo-builds/ -maxdepth 1 -type d -name "xen-orchestra-*" 2>/dev/null))
if [[ $(echo ${#INSTALLATIONS[@]}) -le 1 ]]; then if [[ $(echo ${#INSTALLATIONS[@]}) -le 1 ]]; then
echo -e "${INFO} Only one installation exists, nothing to change" echo -e "${INFO} One or less installations exist, nothing to change"
exit 0 exit 0
fi fi