From d54c894dc0121555c30d7c61dfab1c19fc4cbe99 Mon Sep 17 00:00:00 2001 From: monlor Date: Fri, 6 Mar 2020 11:54:39 +0800 Subject: [PATCH] 2020-03-06 11:54:38 --- apps/mixbox/config/mixbox.uci | 2 +- apps/mixbox/scripts/helper.sh | 6 +++--- install.sh | 6 +++--- tools/gitsync.sh | 14 +++++++++----- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/apps/mixbox/config/mixbox.uci b/apps/mixbox/config/mixbox.uci index 4d5c872..6ddec1d 100644 --- a/apps/mixbox/config/mixbox.uci +++ b/apps/mixbox/config/mixbox.uci @@ -4,4 +4,4 @@ needver="" supports="linux_arm,linux_mips,linux_x86_64" appinfo="一款支持多平台,多架构的Shell工具箱" newinfo="新增base64_encode工具" -version="0.1.9.1" +version="0.1.9.2" diff --git a/apps/mixbox/scripts/helper.sh b/apps/mixbox/scripts/helper.sh index 63e1687..e9d295b 100644 --- a/apps/mixbox/scripts/helper.sh +++ b/apps/mixbox/scripts/helper.sh @@ -9,11 +9,11 @@ wgetsh() { [ ! -d "$wgetfiledir" ] && mkdir -p $wgetfiledir [ ! -d ${mbtmp} ] && mkdir -p ${mbtmp} rm -rf ${mbtmp}/${wgetfilename} - if command -v wget-ssl &> /dev/null; then + if command -v curl &> /dev/null; then + result1=$(curl -skL --connect-timeout 10 -m 20 -w %{http_code} -o "${mbtmp}/${wgetfilename}" "$wgeturl") + else wget-ssl -q --no-check-certificate --tries=1 --timeout=10 -O "${mbtmp}/${wgetfilename}" "$wgeturl" [ $? -eq 0 ] && result="200" - else - result1=$(curl -skL --connect-timeout 10 -m 20 -w %{http_code} -o "${mbtmp}/${wgetfilename}" "$wgeturl") fi [ -f "${mbtmp}/${wgetfilename}" ] && result2=$(du -sh "${mbtmp}/${wgetfilename}" 2> /dev/null | awk '{print$1}') if [ "$result" = "200" ] && [ "$result2" != '0' ]; then diff --git a/install.sh b/install.sh index e75e8f2..2e2b282 100644 --- a/install.sh +++ b/install.sh @@ -47,11 +47,11 @@ fi logsh "【Tools】" "下载工具箱文件..." rm -rf ${mbtmp}/mixbox.tar.gz > /dev/null 2>&1 -if command -v wget-ssl &> /dev/null; then +if command -v curl &> /dev/null; then + result=$(curl -w %{http_code} -skLo ${mbtmp}/mixbox.tar.gz ${mburl}/appstore/mixbox_${model}.tar.gz) +else wget-ssl -q --no-check-certificate --tries=1 --timeout=10 -O ${mbtmp}/mixbox.tar.gz ${mburl}/appstore/mixbox_${model}.tar.gz [ $? -eq 0 ] && result="200" -else - result=$(curl -w %{http_code} -skLo ${mbtmp}/mixbox.tar.gz ${mburl}/appstore/mixbox_${model}.tar.gz) fi [ "$result" != "200" ] && logsh "【Tools】" "文件下载失败!" && exit 1 logsh "【Tools】" "解压工具箱文件" diff --git a/tools/gitsync.sh b/tools/gitsync.sh index a6e6792..72a3fc3 100755 --- a/tools/gitsync.sh +++ b/tools/gitsync.sh @@ -116,11 +116,15 @@ deploy() { sed -Ei "s#mbfiles/git/raw/[a-z]+#mbfiles/git/raw/$2#" $1/install.sh cd $1 - git init - git config --local user.email "monlor@qq.com" - git config --local user.name "monlor" - git add . - git commit -m "$(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")" -a + if [ ! -d ".git" ]; then + git init + git config --local user.email "monlor@qq.com" + git config --local user.name "monlor" + fi + if git status &> /dev/null; then + git add . + git commit -m "$(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")" -a + fi git push "$3" master:"$2" -f }