5 Star 5 Fork 7

dengly/Ice-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
IceApp.sh 3.00 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
source /etc/profile
SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
SELF_PATH=`dirname $SELF`
action="$1"
Ice_Version="3.6.1"
Ice_gridregistry_config="./Ice_gridregistry/icegridregistry.cfg"
Ice_gridregistry_log="${SELF_PATH}/Ice_gridregistry/Ice_gridregistry.log"
Ice_gridregistry_pid_file="${SELF_PATH}/Ice_gridregistry/IceGridRegistry.pid"
Ice_gridnode_config="./Ice_gridnode/icegridnode1.cfg"
Ice_gridnode_log="${SELF_PATH}/Ice_gridnode/Ice_gridnode.log"
Ice_gridnode_pid_file="${SELF_PATH}/Ice_gridnode/Ice_gridnode.pid"
Ice_glacier2_config="./Ice_glacier2/iceglacier2.cfg"
Ice_glacier2_log="${SELF_PATH}/Ice_glacier2/Ice_glacier2.log"
Ice_glacier2_pid_file="${SELF_PATH}/Ice_glacier2/Ice_glacier2.pid"
#ice grid registry
start_gridregistry(){
icegridregistry --Ice.Config=${Ice_gridregistry_config} >>${Ice_gridregistry_log} 2>&1 &
echo $!>${Ice_gridregistry_pid_file}
echo "启动Ice ${Ice_Version} Grid Registry,PID=`cat ${Ice_gridregistry_pid_file}`"
}
stop_gridregistry(){
if [ -f ${Ice_gridregistry_pid_file} ] ;then
kill -term `cat ${Ice_gridregistry_pid_file}`
rm -f ${Ice_gridregistry_pid_file}
echo "关闭Ice ${Ice_Version} Grid Registry"
else
echo "Ice ${Ice_Version} Grid Registry未启动"
fi
}
restart_gridregistry(){
stop_gridregistry
sleep 2
start_gridregistry
}
#ice grid node
start_gridnode(){
icegridnode --Ice.Config=${Ice_gridnode_config} >>${Ice_gridnode_log} 2>&1 &
echo $!>${Ice_gridnode_pid_file}
echo "启动Ice ${Ice_Version} Grid Node,PID=`cat ${Ice_gridnode_pid_file}`"
}
stop_gridnode(){
if [ -f ${Ice_gridnode_pid_file} ] ;then
kill -term `cat ${Ice_gridnode_pid_file}`
rm -f ${Ice_gridnode_pid_file}
echo "关闭Ice ${Ice_Version} Grid Node"
else
echo "Ice ${Ice_Version} Grid Node未启动"
fi
}
restart_gridnode(){
stop_gridnode
sleep 2
start_gridnode
}
#glacier2
start_glacier2(){
glacier2router --Ice.Config=${Ice_glacier2_config} >>${Ice_glacier2_log} 2>&1 &
echo $!>${Ice_glacier2_pid_file}
echo "启动Ice ${Ice_Version} Glacier2,PID=`cat ${Ice_glacier2_pid_file}`"
}
stop_glacier2(){
if [ -f ${Ice_glacier2_pid_file} ] ;then
kill -term `cat ${Ice_glacier2_pid_file}`
rm -f ${Ice_glacier2_pid_file}
echo "关闭Ice ${Ice_Version} Glacier2"
else
echo "Ice ${Ice_Version} Glacier2未启动"
fi
}
restart_glacier2(){
stop_glacier2
sleep 2
start_glacier2
}
start(){
start_gridregistry
sleep 2
start_gridnode
sleep 2
start_glacier2
}
stop(){
stop_glacier2
sleep 2
stop_gridnode
sleep 2
stop_gridregistry
}
restart(){
stop
sleep 2
start
}
case "${action:-''}" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
restartGlaicer2)
restart_glacier2
;;
*)
echo "Usage:$0 start|stop|restart|restartGlaicer2"
exit 1
;;
esac
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/dengly/Ice-demo.git
[email protected]:dengly/Ice-demo.git
dengly
Ice-demo
Ice-demo
master

搜索帮助