From e6673676bda141e87a1963335af466b0136feb1e Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 May 2022 22:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20sp?= =?UTF-8?q?ark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/spark-get-s?= =?UTF-8?q?cale.sh=20=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20spark-dw?= =?UTF-8?q?ine-launch/run-template=5Fv1.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spark-dwine-helper/spark-get-scale.sh | 23 ++++++++------- spark-dwine-launch/run-template_v1.sh | 29 ++++++++++--------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/spark-get-scale.sh b/spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/spark-get-scale.sh index 833f14f..cd98799 100755 --- a/spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/spark-get-scale.sh +++ b/spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/spark-get-scale.sh @@ -1,4 +1,16 @@ #/bin/bash +#########>>>>>>>函数段 +Get_Dist_Name() +{ + if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then + DISTRO='Deepin' + elif grep -Eqi "Uniontech" /etc/issue || grep -Eq "Uniontech" /etc/*-release; then + DISTRO='UniontechOS' + else + DISTRO='OtherOS' + fi +} +#########<<<<<<< if [ $# -lt 1 ]; then echo "无参数,无法启动。请参考set-dwine-scale.sh使用" @@ -54,14 +66,3 @@ esac echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt -#########>>>>>>>函数段 -Get_Dist_Name() -{ - if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then - DISTRO='Deepin' - elif grep -Eqi "Uniontech" /etc/issue || grep -Eq "Uniontech" /etc/*-release; then - DISTRO='UniontechOS' - else - DISTRO='OtherOS' - fi -} diff --git a/spark-dwine-launch/run-template_v1.sh b/spark-dwine-launch/run-template_v1.sh index 9f85644..a4a9ea3 100755 --- a/spark-dwine-launch/run-template_v1.sh +++ b/spark-dwine-launch/run-template_v1.sh @@ -14,6 +14,21 @@ # # +#######################函数段。下文调用的额外功能会在此处声明 + +Get_Dist_Name() +{ + if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then + DISTRO='Deepin' + elif grep -Eqi "Uniontech" /etc/issue || grep -Eq "Uniontech" /etc/*-release; then + DISTRO='UniontechOS' + else + DISTRO='OtherOS' + fi +} + +####获得发行版名称 + #########################预设值段 version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } @@ -79,17 +94,3 @@ else fi -#######################函数段。上文调用的额外功能会在此处声明 - -Get_Dist_Name() -{ - if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then - DISTRO='Deepin' - elif grep -Eqi "Uniontech" /etc/issue || grep -Eq "Uniontech" /etc/*-release; then - DISTRO='UniontechOS' - else - DISTRO='OtherOS' - fi -} - -####获得发行版名称 \ No newline at end of file