修改base64加密工具,修改versioncmp方式

This commit is contained in:
monlor
2020-03-07 18:51:13 +08:00
parent f370563c8d
commit 4594246d1c
14 changed files with 11 additions and 19 deletions

BIN
apps/mixbox/bin/base64_linux_arm Executable file

Binary file not shown.

BIN
apps/mixbox/bin/base64_linux_mips Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,4 +4,4 @@ needver=""
supports="linux_arm,linux_mips,linux_x86_64"
appinfo="一款支持多平台多架构的Shell工具箱"
newinfo="修复mixbox命令错误"
version="0.1.9.5"
version="0.1.9.6"

View File

@@ -40,11 +40,7 @@ base_encode() {
if [ -z "${1}" ]; then
echo -n ""
else
if base64-encode &> /dev/null; then
echo -n "$*" | base64-encode
else
echo -n "$*" | baseutil --b64
fi
echo -n "$*" | base64
fi
}
@@ -52,26 +48,22 @@ base_decode() {
if [ -z "${1}" ]; then
echo -n ""
else
if base64-decode &> /dev/null; then
echo -n "$*" | base64-decode
else
echo -n "$*" | baseutil --b64 -d
fi
echo -n "$*" | base64 -d
fi
}
# $1 > $2 => -1
# $1 < $2 => 1
# $1 = $2 => 0
# versioncmp() {
versioncmp() {
# [ "$1" = "$2" ] && echo -n "0" && return
[ "$1" = "$2" ] && echo -n "0" && return
# if test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; then
# echo -n "-1"
# else
# echo -n "1"
# fi
if test "$(echo "$@" | tr " " "\n" | sort | head -n 1)" != "$1"; then
echo -n "-1"
else
echo -n "1"
fi
# }
}