more rubust check in prerequisites
This commit is contained in:
parent
351a23ce0d
commit
ec208ba22a
@ -156,8 +156,11 @@ function suse_install_codecs(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_prerequisites(){
|
function check_prerequisites(){
|
||||||
|
set +e
|
||||||
local answer
|
local answer
|
||||||
if !type git > /dev/null 2>&1;then
|
type git > /dev/null 2>&1
|
||||||
|
RESULT=$?
|
||||||
|
if [[ $RESULT != 0 ]];then
|
||||||
printf "git is not installed, do your want to install it [y/N]?"
|
printf "git is not installed, do your want to install it [y/N]?"
|
||||||
read -r -n 1 -s answer;
|
read -r -n 1 -s answer;
|
||||||
printf "\n"
|
printf "\n"
|
||||||
@ -166,7 +169,9 @@ function check_prerequisites(){
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if type !salt-call > /dev/null 2>&1;then
|
type salt-call > /dev/null 2>&1
|
||||||
|
RESULT=$?
|
||||||
|
if [[ $RESULT != 0 ]];then
|
||||||
printf "salt-minion is not installed, do your want to install it [y/N]?"
|
printf "salt-minion is not installed, do your want to install it [y/N]?"
|
||||||
read -r -n 1 -s answer;
|
read -r -n 1 -s answer;
|
||||||
printf "\n"
|
printf "\n"
|
||||||
@ -174,6 +179,7 @@ function check_prerequisites(){
|
|||||||
sudo zypper install --non-interactive salt-minion
|
sudo zypper install --non-interactive salt-minion
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
#initialize all options
|
#initialize all options
|
||||||
|
Loading…
Reference in New Issue
Block a user