1 Star 0 Fork 1

rico/envpro

forked from 吴伟桦/envpro 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
envpro.sh 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
rico 提交于 2024-04-23 14:55 . 加了批处理启停
#!/bin/bash
if [ "$1" = "" ];
then
echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m"
exit 1
fi
cd ~/envpro
source ./jar_go.sh
declare -A site
site["reg"]="envpro-register"
site["gw"]="envpro-gateway"
site["auth"]="envpro-auth"
site["upms"]="envpro-upms-biz"
site["mp"]="envpro-mp-platform"
site["codegen"]="envpro-codegen"
site["app"]="envpro-app-server-biz"
site["oa"]="envpro-oa-platform"
site["pay"]="envpro-pay-platform"
site["jimu"]="envpro-jimu-platform"
site["seata"]="envpro-seata-server"
site["report"]="envpro-report-platform"
site["quartz"]="envpro-daemon-quartz"
site["xxjob"]="envpro-xxl-job-admin"
site["es"]="envpro-daemon-elastic-job"
site["sentinel"]="envpro-sentinel-dashboard"
site["monitor"]="envpro-monitor"
for key in ${!site[*]};do
echo "${key} : ${site[$key]}"
done
# 定义指令数组
#commands=("echo 'Hello, World!'" "ls -l" "pwd" "date")
# 询问用户输入键值
read -p "请输入要执行的指令的键值(以空格分隔): " keys
# 将输入的键值转换为数组
IFS=' ' read -ra ADDR <<< "$keys"
# 遍历用户输入的键值
for key in "${ADDR[@]}"; do
# 检查键值是否在数组范围内
if (( key >= 0 && key < ${#site[@]} )); then
# 执行相应的指令
eval echo "================"${site[$key]}"================"
eval exec $1 ${site[$key]}
else
echo "错误:键值 $key 不在有效范围内."
fi
done
# 脚本结束
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wwrico/envpro.git
git@gitee.com:wwrico/envpro.git
wwrico
envpro
envpro
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385