master
1#!/bin/bash
2#tmux start-server
3#tmux new-session -t 0
4
5tmux has-session -t imsCore # determine if this is a reload
6OUT=$?
7if [ $OUT -eq 0 ]; # true = 0
8then
9 tmux detach-client -s imsCore
10# tmux kill-pane -a -t imsCore:core.4 # reload - kill all existing except pane 4
11# tmux kill-window -t imsCore:core
12 tmux kill-session -t imsCore
13 tmux new-session -d -s imsCore -x 160 -y 48 # fresh launch :)
14# tmux rename-window -t imsCore:core garbage # prepare the old core for destruction
15 tmux new-window -n core -k
16else
17 tmux start-server
18 tmux new-session -d -s imsCore -x 160 -y 48 # fresh launch :)
19 tmux new-window -n core -k
20fi
21
22# Launch all the Core Daemons
23tmux splitw -h -t imsCore:core.0 "cd /opt/OpenIMSCore; sleep 1;bash -c ./pcscf.sh"
24tmux splitw -h -t imsCore:core.1 "cd /opt/OpenIMSCore; sleep 1; bash -c ./icscf.sh"
25tmux splitw -h -t imsCore:core.2 "cd /opt/OpenIMSCore; sleep 1; bash -c ./scscf.sh"
26tmux splitw -h -t imsCore:core.3 "cd /opt/OpenIMSCore/FHoSS/deploy; sleep 1; bash -c ./startup.sh"
27# tmux splitw -h -t imsCore:core.4 "cd; bash"
28
29# Cleanup all the mess we made of the panes/windows
30tmux kill-pane -t imsCore:core.0
31tmux select-window -t imsCore:core
32tmux select-layout -t imsCore:core main-horizontal #tiled
33tmux swap-window -s imsCore:core -t imsCore:0
34tmux rename-window -t imsCore:1 mgmt
35tmux attach
36# tmux kill-window -t garbage
37