Просмотр исходного кода

Minor fixes to theme backend code

Kristan Kenney 6 лет назад
Родитель
Сommit
7eb1f6d75b

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

@@ -18,6 +18,11 @@ source $HESTIA/conf/hestia.conf
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Initialize local directory if it does not exist
+if [ ! -d "$HESTIA_THEMES_CUSTOM" ]; then
+    mkdir -p $HESTIA_THEMES_CUSTOM
+fi
+
 # Theme argument and file detection
 if [ -z "$theme" ]; then
     echo "ERROR: No theme specified."

+ 6 - 4
bin/v-list-sys-themes

@@ -81,13 +81,15 @@ csv_list() {
 #----------------------------------------------------------#
 
 # Parsing templates
+
+# System provided themes
 themes=$(ls -v $HESTIA_THEMES/)
 themes=$(echo "$themes" | grep '\.css' | sed 's/\.css$//')
 
-if [ ! -z "$HESTIA_THEMES_CUSTOM" ]; then
-    themes_custom=$(ls -v $HESTIA_THEMES_CUSTOM/)
-    themes_custom=$(echo "$themes_custom" | grep '\.css' | sed 's/\.css$//')
-fi
+# Custom themes
+themes_custom=$(ls -v $HESTIA_THEMES_CUSTOM/)
+themes_custom=$(echo "$themes_custom" | grep '\.css' | sed 's/\.css$//')
+
 
 # Listing data
 case $format in

+ 1 - 1
install/hst-install-debian.sh

@@ -1823,7 +1823,7 @@ fi
 $HESTIA/bin/v-change-sys-port $port
 
 # Set default theme
-$HESTIA/bin/v-change-sys-config-value 'THEME' "default"
+$HESTIA/bin/v-change-sys-theme 'default'
 
 # Starting Hestia service
 update-rc.d hestia defaults

+ 1 - 1
install/hst-install-ubuntu.sh

@@ -1710,7 +1710,7 @@ fi
 $HESTIA/bin/v-change-sys-port $port
 
 # Set default theme
-$HESTIA/bin/v-change-sys-config-value 'THEME' "default"
+$HESTIA/bin/v-change-sys-theme 'default'
 
 # Starting Hestia service
 update-rc.d hestia defaults

+ 1 - 1
install/upgrade/versions/latest.sh

@@ -9,7 +9,7 @@
 # Set default theme
 if [ -z $THEME ]; then
     echo "(*) Enabling support for themes..."
-    $BIN/v-change-sys-config-value 'THEME' default
+    $BIN/v-change-sys-theme 'default'
 fi
 
 # Reduce SSH login grace time