From 146ef2de3f9e9a1d4a1ac3e2bc196ae97be2355e Mon Sep 17 00:00:00 2001 From: Leon <62660101+Oreomeow@users.noreply.github.com> Date: Wed, 21 Jul 2021 12:40:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/sh/1custom.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Scripts/sh/1custom.sh b/Scripts/sh/1custom.sh index 8bc3380..39b488a 100644 --- a/Scripts/sh/1custom.sh +++ b/Scripts/sh/1custom.sh @@ -13,7 +13,7 @@ task_before_shell_path=$dir_shell/task_before.sh # 控制是否执行变量 echo "以下操作默认为是,不需要的请输入 n" read -p "是否全部替换或下载,建议初次配置选择,输入 1 即可全部替换,默认不全部:" Rall -if [ $Rall != "1" ]; then +if [ ${Rall} != "1" ]; then read -p "是否替换或下载 config.sh y/n:" Rconfig Rconfig=${Rconfig:-'y'} read -p "是否替换或下载 extra.sh y/n:" Rextra @@ -30,7 +30,7 @@ fi if [ ! -a "$config_shel_path" ]; then touch $config_shell_path fi -if [ $Rconfig = 'y' -o $Rall = "1" ]; then +if [ ${Rconfig} = 'y' -o ${Rall} = 1 ]; then curl -s --connect-timeout 3 https://raw.githubusercontent.com/Oreomeow/VIP/main/Conf/Qinglong/config.sample.sh > $config_shell_path cp $config_shell_path $dir_shell/config.sh # 判断是否下载成功 @@ -48,7 +48,7 @@ fi if [ ! -a "$extra_shell_path" ]; then touch $extra_shell_path fi -if [ $Rextra = 'y' -o $Rall = "1" ]; then +if [ ${Rextra} = 'y' -o ${Rall} = 1 ]; then curl -s --connect-timeout 3 https://raw.githubusercontent.com/Oreomeow/VIP/main/Tasks/qlrepo/extra.sh > $extra_shell_path cp $extra_shell_path $dir_shell/extra.sh # 判断是否下载成功 @@ -80,7 +80,7 @@ fi if [ ! -a "$code_shell_path" ]; then touch $code_shell_path fi -if [ $Rcode = 'y' -o $Rall = "1" ]; then +if [ ${Rcode} = 'y' -o ${Rall} = 1 ]; then curl -s --connect-timeout 3 https://raw.githubusercontent.com/Oreomeow/VIP/main/Scripts/sh/Helpcode2.8/code.sh > $code_shell_path cp $code_shell_path $dir_shell/code.sh # 判断是否下载成功 @@ -112,7 +112,7 @@ fi if [ ! -a "$task_before_shell_path" ] ; then touch $task_before_shell_path fi -if [ $Rbefore = 'y' -o $Rall = "1" ]; then +if [ ${Rbefore} = 'y' -o ${Rall} = 1 ]; then curl -s --connect-timeout 3 https://raw.githubusercontent.com/Oreomeow/VIP/main/Scripts/sh/Helpcode2.8/task_before.sh > $task_before_shell_path # 判断是否下载成功 task_before_size=$(ls -l $task_before_shell_path | awk '{print $5}') @@ -126,9 +126,9 @@ fi # 添加定时任务 ql bot -if [ "$(grep -c bot /ql/config/crontab.list)" != 0 -a $Rbot = 'y' ]; then +if [ "$(grep -c bot /ql/config/crontab.list)" != 0 -a ${Rbot} = 'y' ]; then echo "您的任务列表中已存在 task ql bot" -elif [ "$(grep -c bot /ql/config/crontab.list)" = 0 ] && [ $Rbot = 'y' -o $Rall = "1" ]; then +elif [ "$(grep -c bot /ql/config/crontab.list)" = 0 ] && [ ${Rbot} = 'y' -o ${Rall} = 1 ]; then echo "开始添加 task ql bot" # 获取token token=$(cat /ql/config/auth.json | jq --raw-output .token)