From 3299911086ece373d60b4e1696d007ddfe9be715 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 16 Mar 2015 17:38:02 +0100 Subject: [PATCH] - yWeb: allow style_set function w/o parameter to install correct style --- src/nhttpd/web/Y_Version.txt | 4 ++-- src/nhttpd/web/scripts/Y_Tools.sh | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 39f8ecf2c..64131253f 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.12 -date=04.03.2015 +version=2.9.0.13 +date=16.03.2015 type=Release info=Port CST diff --git a/src/nhttpd/web/scripts/Y_Tools.sh b/src/nhttpd/web/scripts/Y_Tools.sh index b565a28ad..0f67f644f 100755 --- a/src/nhttpd/web/scripts/Y_Tools.sh +++ b/src/nhttpd/web/scripts/Y_Tools.sh @@ -51,16 +51,23 @@ style_get() # ----------------------------------------------------------- style_set() { + # This function should be called one time after installing a new image + # to get sure, the right skin is installed too + + style=${1:-$(config_get_value_direct $y_config_Y_Web 'style')} + test -n "$style" || return + y_path_directory=$(config_get_value_direct $y_config_nhttpd 'WebsiteMain.directory') y_path_override_directory=$(config_get_value_direct $y_config_nhttpd 'WebsiteMain.override_directory') cd $y_path_directory - if [ -e $y_path_override_directory/styles/Y_Dist-$1.css ]; then - cp $y_path_override_directory/styles/Y_Dist-$1.css Y_Dist.css + if [ -e $y_path_override_directory/styles/Y_Dist-$style.css ]; then + cp $y_path_override_directory/styles/Y_Dist-$style.css Y_Dist.css + elif [ -e $y_path_directory/styles/Y_Dist-$style.css ]; then + cp $y_path_directory/styles/Y_Dist-$style.css Y_Dist.css else - cp $y_path_directory/styles/Y_Dist-$1.css Y_Dist.css + config_set_value_direct $y_config_Y_Web 'style' fi - #config_set_value_direct $y_config_Y_Web 'style' $1 } # ----------------------------------------------------------- # Image Backup - build form