🔨Fix errors && Add dl & unzip utils.zip

This commit is contained in:
Leon 2021-07-18 17:29:39 +08:00 committed by GitHub
parent d1c4b45f43
commit 8e7528b016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ config_shell_path=$dir_shell/config.sh
extra_shell_path=$dir_shell/extra.sh
code_shell_path=$dir_shell/code.sh
task_before_shell_path=$dir_shell/task_before.sh
utils_path=$dir_script/utils.zip
# 控制是否执行变量
@ -58,10 +59,14 @@ if [ $Rextra = 'y' ]; then
chmod 755 $extra_shell_path
# extra.sh 预设仓库及默认拉取仓库设置
echo -e "1panghu999\n2JDHelloWorld\n3he1pu\n4shufflewzc"
echo -n "输入你想拉取的仓库编号(默认为 4):"
read -r defaultNum
defualtNum=${defaultNum:-'4'}
read -p "输入你想拉取的仓库编号(默认为 4):" defaultNum
defaultNum=${defaultNum:-'4'}
sed -i "s/\$default4/\$default$defaultNum/g" $extra_shell_path
# 下载 faker2 utils.zip
if [ $defaultNum = '4' ]; then
curl -s https://raw.githubusercontent.com/Oreomeow/VIP/main/Scripts/js/utils.zip > $utils_path && unzip -o $utils_path -d $dir_script
rm -f $utils_path
fi
# 将 extra.sh 添加到定时任务
if [ "$(grep -c extra /ql/config/crontab.list)" = 0 ]; then
echo "开始添加 task ql extra"
@ -91,8 +96,7 @@ if [ $Rcode = 'y' ]; then
chmod 755 $code_shell_path
# code.sh 预设仓库及默认调用仓库设置
echo -e "## 将\"repo=\$repo1\"改成\"repo=\$repo2\"或其他,以默认调用其他仓库脚本日志\nrepo1='panghu999_jd_scripts' #预设的 panghu999 仓库\nrepo2='JDHelloWorld_jd_scripts' #预设的 JDHelloWorld 仓库\nrepo3='he1pu_JDHelp' #预设的 he1pu 仓库\nrepo4='shufflewzc_faker2' #预设的 shufflewzc 仓库\nrepo=\$repo1 #默认调用 panghu999 仓库脚本日志"
echo -n "输入你想调用的仓库编号(默认为 4):"
read -r repoNum
read -p "输入你想调用的仓库编号(默认为 4):"
repoNum=${repoNum:-'4'}
sed -i "s/\$repo1/\$repo$repoNum/g" $code_shell_path
# 将 code.sh 添加到定时任务
@ -134,4 +138,4 @@ elif [ "$(grep -c bot /ql/config/crontab.list)" = 0 -a $Rbot = 'y' ]; then
curl -s -H 'Accept: application/json' -H "Authorization: Bearer $token" -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept-Language: zh-CN,zh;q=0.9' --data-binary '{"name":"拉取机器人","command":"ql bot","schedule":"13 14 * * *"}' --compressed 'http://127.0.0.1:5700/api/crons?t=1626247933219'
else
echo "已为您跳过添加定时任务 ql bot"
fi
fi