| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #!/bin/bash
- tm=`date +%Y%m%d-%H%M%S`
- echo "====================================================="
- echo "Operating <${tm}>."
- echo "====================================================="
- echo "Please ensure the config files right."
- echo "====================================================="
- s_home=$(cd `dirname $0`; pwd)
- s_bin=${s_home}/bin
- # change to bin dir
- cd ${s_bin}
- start(){
- # 启动前请修改
- # IP替换
- sh replace.sh 192.168.3.230 192.168.3.230 mysql mysql
- if [ $? != 0 ] ; then
- exit 1
- fi
-
- # 启动容器
- sh docker.compose.mysql.up.sh
- sh docker.compose.data.up.sh
- sh docker.compose.app.up.sh
- }
- stop(){
- sh docker.compose.app.down.sh
- sh docker.compose.data.down.sh
- sh docker.compose.mysql.down.sh
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart|reload)
- stop
- start
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart}"
- exit 1
- esac
- exit
|