From 351a23ce0de746bded06753527e5105bf4b490c2 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Thu, 6 Aug 2020 11:51:15 +0200 Subject: [PATCH] added check_prerequisites --- bin/initDesktop | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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