diff --git a/bin/initDesktop b/bin/initDesktop index 3549edb..436d924 100755 --- a/bin/initDesktop +++ b/bin/initDesktop @@ -156,8 +156,11 @@ function suse_install_codecs(){ } function check_prerequisites(){ + set +e 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]?" read -r -n 1 -s answer; printf "\n" @@ -166,7 +169,9 @@ function check_prerequisites(){ 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]?" read -r -n 1 -s answer; printf "\n" @@ -174,6 +179,7 @@ function check_prerequisites(){ sudo zypper install --non-interactive salt-minion fi fi + set -e } #initialize all options