From a6dd4961b10e5dc3c856f90418e7cb2a3e971e47 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 14 Jun 2017 21:25:25 +0100 Subject: [PATCH] Extra politeness on install --- src/freedombone-config | 20 +++++++++++++++++--- src/freedombone-controlpanel | 2 +- src/freedombone-utils-keys | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/freedombone-config b/src/freedombone-config index 6dd04ba8..6ceb9f31 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -109,6 +109,20 @@ if [ -f /usr/bin/${PROJECT_NAME} ]; then PROJECT_INSTALL_DIR=/usr/bin fi +function please_wait { + local str width height length + + width=$(tput cols) + height=$(tput lines) + str=$"Please wait" + length=${#str} + clear + tput cup $((height / 2)) $(((width / 2) - (length / 2))) + echo "$str" + tput cup $((height * 3 / 5)) $(((width / 2))) + echo -n '' +} + source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-vars UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-* @@ -608,7 +622,7 @@ function choose_username { if [ ${#possible_username} -gt 1 ]; then if [[ $possible_username != $GENERIC_IMAGE_USERNAME ]]; then MY_USERNAME=$(cat $data) - clear + please_wait echo $'Creating user account' chmod 600 /etc/shadow chmod 600 /etc/gshadow @@ -693,7 +707,7 @@ function choose_full_name { esac done save_configuration_values - clear + please_wait } function choose_system_variant { @@ -971,7 +985,7 @@ function interactive_select_language { esac save_configuration_values - clear + please_wait echo 'Setting locale' locale-gen "${DEFAULT_LANGUAGE}" diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index b610b6e4..073f5749 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -38,7 +38,7 @@ function please_wait { width=$(tput cols) height=$(tput lines) - str="Please wait" + str=$"Please wait" length=${#str} clear tput cup $((height / 2)) $(((width / 2) - (length / 2))) diff --git a/src/freedombone-utils-keys b/src/freedombone-utils-keys index cc112853..cd5f72b5 100755 --- a/src/freedombone-utils-keys +++ b/src/freedombone-utils-keys @@ -235,6 +235,7 @@ function interactive_key_recovery { 1) return;; 255) return;; esac + clear apt-get -yq install cryptsetup ${PROJECT_NAME}-recoverkey -u $MY_USERNAME if [ -d /home/$MY_USERNAME/.gnupg ]; then