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