diff --git a/bbb-pre-install.sh b/bbb-pre-install.sh index dd894c7..f55d9a2 100755 --- a/bbb-pre-install.sh +++ b/bbb-pre-install.sh @@ -187,11 +187,15 @@ DEFAULT_FQDN_HOSTNAME="$(hostname -f)" declare -a needed_debian_package_arr=() NEEDED_DEBIAN_PACKAGES=" + figlet + mc + vim haveged apt-utils apt-transport-https ca-certificates curl + lsb-release software-properties-common " @@ -324,6 +328,60 @@ echo -e " \033[32mInstall missing Debian packages\033[m" echo -e " \033[1m---\033[m" echo "" +echononl "Update repositories.." +apt-get update > "$log_file" 2>&1 +if [[ $? -ne 0 ]]; then + echo_failed + error "$(cat "$log_file")" + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interrupted by user." + +else + echo_ok +fi + +echononl "Upgrade System.." +DEBIAN_FRONTEND=noninteractive apt-get full-upgrade --assume-yes > "$log_file" 2>&1 +if [[ $? -ne 0 ]]; then + echo_failed + error "$(cat "$log_file")" + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interrupted by user." + + +echononl "Install package 'aptitude'.." +DEBIAN_FRONTEND=noninteractive apt-get -y install aptitude > "$log_file" 2>&1 +if [[ $? -eq 0 ]] ; then + echo_ok +else + echo_failed + error "$(cat $log_file)" + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interrupted by user." +fi + + _error=false : > $log_file @@ -355,40 +413,6 @@ fi if [[ ${#needed_debian_package_arr[@]} -gt 0 ]]; then - echononl "Update repositories.." - apt-get update > "$log_file" 2>&1 - if [[ $? -ne 0 ]]; then - echo_failed - error "$(cat "$log_file")" - - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/no]: " - read OK - done - [[ $OK = "yes" ]] || fatal "Interrupted by user." - - else - echo_ok - fi - - echononl "Upgrade System.." - DEBIAN_FRONTEND=noninteractive apt-get full-upgrade --assume-yes > "$log_file" 2>&1 - if [[ $? -ne 0 ]]; then - echo_failed - error "$(cat "$log_file")" - - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/no]: " - read OK - done - [[ $OK = "yes" ]] || fatal "Interrupted by user." - for _debian_pkg in ${needed_debian_package_arr[@]} ; do