Pārlūkot izejas kodu

Add call to sanitize_config_file on user rebuild

Ensure variables are set and created if missing
Kristan Kenney 5 gadi atpakaļ
vecāks
revīzija
b90423c2d7
2 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 5 0
      bin/v-change-user-theme
  2. 2 0
      func/rebuild.sh

+ 5 - 0
bin/v-change-user-theme

@@ -46,6 +46,11 @@ check_hestia_demo_mode
 #----------------------------------------------------------#
 
 # Set theme value
+check_ckey=$(grep "THEME" $USER_DATA/user.conf)
+if [ -z "$check_ckey" ]; then
+    # Rebuild user configuration to repair missing value
+    $BIN/v-rebuild-user $user
+fi
 update_user_value "$user" '$THEME' "$theme"
 
 #----------------------------------------------------------#

+ 2 - 0
func/rebuild.sh

@@ -1,6 +1,8 @@
 # User account rebuild
 rebuild_user_conf() {
 
+    sanitize_config_file "user"
+
     # Get user variables
     source $USER_DATA/user.conf