diff --git a/run b/run index c0671f58e93252f72f6af97548d39d0f7d1c80cf..9df192fadee02ca84259699a4f2d1a89921b1f0e 100755 --- a/run +++ b/run @@ -383,8 +383,16 @@ read -p "请输入序号:" op_pro if [ "$op_pro" == "n" ]; then subber elif [ "$op_pro" == "d" ]; then - read -p "请输入你要删除的插件序号:" sub - eval "sub=\$sub$subn" + read -p "请输入你要删除的插件序号:" op_pro + for key in ${!mysubs[@]} + do + if [ "$key" == "$op_pro" ]; then + sub=${mysubs[$key]} + break + fi + done + op_pro="" + eval "sub=\$sub" #再次确认 read -p "在回车之前,您可以ctrl+c中断删除" null rm -fr $sub @@ -400,10 +408,20 @@ elif [[ $op_pro =~ ^-?[1-9][0-9]*$ ]]; then sleep $sleeptime menu else + for key in ${!mysubs[@]} + do + if [ "$key" == "$op_pro" ]; then + sub=${mysubs[$key]} + break + fi + done + op_pro="" #检验插件完整性 - eval "sub=\$sub$subn" - cd $PROJECT_DIR&&$binner/subs/$sub/run.sh + eval "sub=\$sub" + cd $PROJECT_DIR && sh $binner/subs/$sub/run.sh + sleep $sleeptime subbed + fi else ywarn "请输入正确编号!"