浏览代码

Extra politeness on install

Bob Mottram 7 年前
父节点
当前提交
a6dd4961b1
共有 3 个文件被更改,包括 19 次插入4 次删除
  1. 17
    3
      src/freedombone-config
  2. 1
    1
      src/freedombone-controlpanel
  3. 1
    0
      src/freedombone-utils-keys

+ 17
- 3
src/freedombone-config 查看文件

@@ -109,6 +109,20 @@ if [ -f /usr/bin/${PROJECT_NAME} ]; then
109 109
     PROJECT_INSTALL_DIR=/usr/bin
110 110
 fi
111 111
 
112
+function please_wait {
113
+        local str width height length
114
+
115
+        width=$(tput cols)
116
+        height=$(tput lines)
117
+        str=$"Please wait"
118
+        length=${#str}
119
+        clear
120
+        tput cup $((height / 2)) $(((width / 2) - (length / 2)))
121
+        echo "$str"
122
+        tput cup $((height * 3 / 5)) $(((width / 2)))
123
+        echo -n ''
124
+}
125
+
112 126
 source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-vars
113 127
 
114 128
 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
@@ -608,7 +622,7 @@ function choose_username {
608 622
                            if [ ${#possible_username} -gt 1 ]; then
609 623
                                if [[ $possible_username != $GENERIC_IMAGE_USERNAME ]]; then
610 624
                                    MY_USERNAME=$(cat $data)
611
-                                   clear
625
+                                   please_wait
612 626
                                    echo $'Creating user account'
613 627
                                    chmod 600 /etc/shadow
614 628
                                    chmod 600 /etc/gshadow
@@ -693,7 +707,7 @@ function choose_full_name {
693 707
         esac
694 708
     done
695 709
     save_configuration_values
696
-    clear
710
+    please_wait
697 711
 }
698 712
 
699 713
 function choose_system_variant {
@@ -971,7 +985,7 @@ function interactive_select_language {
971 985
     esac
972 986
     save_configuration_values
973 987
 
974
-    clear
988
+    please_wait
975 989
     echo 'Setting locale'
976 990
 
977 991
     locale-gen "${DEFAULT_LANGUAGE}"

+ 1
- 1
src/freedombone-controlpanel 查看文件

@@ -38,7 +38,7 @@ function please_wait {
38 38
 
39 39
         width=$(tput cols)
40 40
         height=$(tput lines)
41
-        str="Please wait"
41
+        str=$"Please wait"
42 42
         length=${#str}
43 43
         clear
44 44
         tput cup $((height / 2)) $(((width / 2) - (length / 2)))

+ 1
- 0
src/freedombone-utils-keys 查看文件

@@ -235,6 +235,7 @@ function interactive_key_recovery {
235 235
         1) return;;
236 236
         255) return;;
237 237
     esac
238
+    clear
238 239
     apt-get -yq install cryptsetup
239 240
     ${PROJECT_NAME}-recoverkey -u $MY_USERNAME
240 241
     if [ -d /home/$MY_USERNAME/.gnupg ]; then