bbk_scripts/a_wskey_convert.sh
2024-07-09 13:58:33 +08:00

47 lines
1.3 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# new Env('BBK-wskey转换');
# cron 0 0/12 * * * a_wskey_convert.sh
# export JD_LOG_XYZ_TOKEN="从机器人获取的token"
# export BBK_WSKEY_ENC_KEY="" #加密/解密key启用加密的时候需要用到
# export BBK_WSKEY_DISABLE_FAIL="true" #自动禁用失效wskey
pwd
_ftype=""
use_get_arch=${BBK_ARCH}
get_arch=`arch`
if [ "$use_get_arch" != "" ]; then
get_arch=$use_get_arch
echo "指定运行$use_get_arch"
fi
echo $get_arch
if [[ $get_arch =~ "x86_64" ]];then
_ftype="linux-amd64"
elif [[ $get_arch =~ "x86" ]];then
_ftype="linux-386"
elif [[ $get_arch =~ "i386" ]];then
_ftype="linux-386"
elif [[ $get_arch =~ "aarch64" ]];then
_ftype="linux-arm64"
elif [[ $get_arch =~ "arm" ]];then
_ftype="linux-arm"
else
_ftype=""
fi
if [ $_ftype == "" ]; then
echo "不支持的架构$get_arch"
else
echo "执行$_ftype"
if [ -f "$PWD/BBK/$_ftype.bbk" ]; then
echo "$PWD/BBK/$_ftype.bbk"
eval "chmod +x ./BBK/$_ftype.bbk"
eval "./BBK/$_ftype.bbk -t wskey_convert"
else
if [ ! -f "$PWD/$_ftype.bbk" ]; then
echo "$PWD/BBK目录、$PWD目录下均未找到文件$_ftype.bbk"
exit 1
fi
echo "$PWD/$_ftype.bbk"
eval "chmod +x $PWD/$_ftype.bbk"
eval "$PWD/$_ftype.bbk -t wskey_convert"
fi
fi