diff --git a/bin/initDesktop b/bin/initDesktop index 1f5effc..3549edb 100755 --- a/bin/initDesktop +++ b/bin/initDesktop @@ -155,6 +155,27 @@ function suse_install_codecs(){ sudo "$HOME/bin/install_codecs" } +function check_prerequisites(){ + local answer + if !type git > /dev/null 2>&1;then + printf "git is not installed, do your want to install it [y/N]?" + read -r -n 1 -s answer; + printf "\n" + if [[ $answer == [yY] ]];then + sudo zypper install --non-interactive git + fi + fi + + if type !salt-call > /dev/null 2>&1;then + printf "salt-minion is not installed, do your want to install it [y/N]?" + read -r -n 1 -s answer; + printf "\n" + if [[ $answer == [yY] ]];then + sudo zypper install --non-interactive salt-minion + fi + fi +} + #initialize all options ALL=true CODECS=false @@ -211,6 +232,8 @@ while :; do shift done +check_prerequisites + [[ $ALL == true ]] || [[ $DOTFILES == true ]] && setup_dotfiles [[ $ALL == true ]] || [[ $SALT == true ]] && do_salt_call [[ $ALL == true ]] || [[ $FIREFOX == true ]] && firefox_config