bbk_scripts/a_wskey_exit.sh
2024-07-09 13:59:49 +08:00

46 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失效');
# export JD_LOG_XYZ_TOKEN="从机器人获取的token"
# export BBK_WSKEY_ENC_KEY="" #加密/解密key启用加密的时候需要用到
# export USE_BBK_WSKEY_EXIT="true" #启用退出,防止添加任务就自动执行,执行完毕后记得关闭
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_exit"
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_exit"
fi
fi