Mercurial > sat_docs
annotate scripts/launcher/launch.sh @ 23:b10f01885949
docker: fixed libervia_cont update + added some newlines
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 19 Oct 2014 19:44:47 +0200 |
parents | 7b337be4052d |
children | 1eb3ec190ea1 |
rev | line source |
---|---|
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
1 #!/bin/bash |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
2 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
3 # This is a helping script to do some tasks like installing, cleaning, starting sat and/or libervia. |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
4 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
5 # Python dist-packages where project are installed |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
6 PACKAGES=/usr/local/lib/python2.7/dist-packages |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
7 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
8 # Paths to the projects |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
9 WORKSPACE=~/workspace |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
10 SAT=$WORKSPACE/sat |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
11 PYJS=$WORKSPACE/pyjamas |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
12 LIBERVIA=$WORKSPACE/libervia |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
13 PROSODY=$WORKSPACE/prosody-hg |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
14 SATPUBSUB=$WORKSPACE/sat_pubsub |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
15 SALUT=$WORKSPACE/salut |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
16 URWID_SATEXT=$WORKSPACE/urwid_satext |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
17 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
18 # PIDs of the processes |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
19 LOCAL_DIR=~/.local/share/sat |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
20 SAT_PID=$LOCAL_DIR/sat.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
21 LIB_PID=$LOCAL_DIR/libervia.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
22 SER_PID=$PROSODY/prosody.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
23 SPS_PID=$SATPUBSUB/twistd.pid |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
24 SALUT_PID=$SALUT/twistd.pid |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
25 |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
26 # Connection information for Prosody components |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
27 SPS_JID=sat-pubsub.tazar.int |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
28 SPS_PWD=password |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
29 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
30 # Informations for a concurrent sat instance |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
31 # For this to work, you have to follow the instructions in: |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
32 # http://wiki.goffi.org/wiki/Howto_launch_several_S%C3%A0T_instances |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
33 # Also: |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
34 # - modify const_INT_PREFIX in the two DBus.py files |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
35 # - set DAEMON="" in the sat.sh to launch sat as a daemon |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
36 SAT_MAIN=$WORKSPACE/sat_main |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
37 SAT_MAIN_PID=~/.sat_main/sat.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
38 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
39 # 4 Firefox profiles names for testing |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
40 FF_PROFILES=(test1 test2 test3 test4) |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
41 # 4 SàT profiles names for testing |
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
42 SAT_PROFILES=(pierre elisee louise buenaventura) |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
43 # Passwords for these profiles |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
44 SAT_PROFILES_PASSWD=(xxxxxx xxxxxx xxxxxx xxxxxx) |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
45 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
46 # Launch sat in debug mode? |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
47 SAT_DEBUG=1 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
48 # Launch sat pubsub in debug mode? |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
49 SPS_DEBUG=0 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
50 # Launch libervia in debug mode? |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
51 LIB_DEBUG=0 |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
52 # Force killing processes? |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
53 KILL_FORCE=1 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
54 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
55 kill_process() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
56 # $1 is the file containing the PID to kill |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
57 if [ -f $1 ]; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
58 PID=`cat $1` |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
59 if ps -p $PID > /dev/null; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
60 if [[ $KILL_FORCE = 1 ]]; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
61 kill -9 $PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
62 else |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
63 kill -INT $PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
64 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
65 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
66 rm -f $1 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
67 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
68 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
69 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
70 stop_lib() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
71 echo "############ Stopping libervia ############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
72 libervia stop |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
73 kill_process $LIB_PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
74 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
75 stop_sat() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
76 echo "############### Stopping sat ##############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
77 sat stop |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
78 kill_process $SAT_PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
79 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
80 stop_ser() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
81 echo "############# Stopping Prosody ############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
82 cd $PROSODY && if [[ -f $SER_PID ]]; then ./prosodyctl stop; fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
83 kill_process $SER_PID |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
84 echo "####### Stopping Prosody components #######" |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
85 kill_process $SPS_PID |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
86 kill_process $SALUT_PID |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
87 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
88 start_ser() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
89 echo "############# Starting Prosody ############" |
18
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
90 cd $PROSODY && ./prosodyctl start & |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
91 echo "########## Installing sat_pubsub ##########" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
92 cd $SATPUBSUB && sudo python setup.py install |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
93 echo "########### Starting sat-pubsub ###########" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
94 if [[ $SPS_DEBUG = 1 ]]; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
95 mate-terminal -e "twistd -n -b sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD" & |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
96 else |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
97 twistd sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
98 fi |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
99 echo "############## Starting salut #############" |
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
100 cd $SALUT && twistd -y salut.tac |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
101 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
102 start_sat() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
103 echo "############## Installing sat #############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
104 cd $SAT && sudo python setup.py install |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
105 echo "############### Starting sat ##############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
106 if [[ $SAT_DEBUG = 1 ]]; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
107 mate-terminal -e "sat debug" & |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
108 else |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
109 sat |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
110 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
111 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
112 start_lib() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
113 echo "########### Installing libervia ###########" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
114 cd $LIBERVIA && sudo python setup.py install |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
115 echo "############ Starting libervia ############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
116 cd src |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
117 if [[ $LIB_DEBUG = 1 ]]; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
118 mate-terminal -e "libervia debug" & |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
119 else |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
120 libervia |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
121 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
122 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
123 4foxes() { |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
124 # Starts 4 instances of firefox and connect SàT profiles with Libervia |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
125 # Assumes the HTTPS port for local server is 8443 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
126 echo "####### Starting 4 libervia clients #######" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
127 for I in `seq 0 3`; do |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
128 URL="https://localhost:8443/libervia.html?login=${SAT_PROFILES[$I]}&passwd=${SAT_PROFILES_PASSWD[$I]}" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
129 firefox -no-remote -P ${FF_PROFILES[$I]} "$URL" & |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
130 done |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
131 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
132 clean() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
133 echo "############ Cleaning log files ###########" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
134 rm -f $LOCAL_DIR/*.log* |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
135 rm -f $SATPUBSUB/twistd.log* |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
136 rm -f $PROSODY/prosody.log* $PROSODY/prosody.err* |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
137 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
138 purge() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
139 echo "######## Purging installed packages #######" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
140 rm -rf $PACKAGES/sat |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
141 rm -rf $PACKAGES/sat_frontends |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
142 rm -rf $PACKAGES/libervia |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
143 rm -rf $PACKAGES/libervia_server |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
144 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
145 main() { |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
146 echo "######## Starting SàT main instance #######" |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
147 export PYTHONPATH=$SAT_MAIN/lib |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
148 cd $SAT_MAIN/lib/sat && hg pull -u && ./sat.sh |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
149 echo "#### Starting primitivus main instance ####" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
150 cd $SAT_MAIN/lib/sat_frontends/primitivus && ./primitivus |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
151 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
152 bridge() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
153 echo "######### Generating DBus.py files ########" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
154 cd $SAT/src/bridge/bridge_constructor |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
155 ./bridge_constructor.py --force && cp generated/DBus.py ../DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
156 ./bridge_constructor.py -s frontend --force && cp generated/DBus.py ../../../frontends/src/bridge/DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
157 cd $SAT_MAIN/src/bridge/bridge_constructor |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
158 SAT_BRIDGE_CONST_INT_PREFIX='"org.goffi.sat_main"' ./bridge_constructor.py --force && cp generated/DBus.py ../DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
159 SAT_BRIDGE_CONST_INT_PREFIX='"org.goffi.sat_main"' ./bridge_constructor.py -s frontend --force && cp generated/DBus.py ../../../frontends/src/bridge/DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
160 } |
18
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
161 monitor_core() { |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
162 echo "## Monitoring DBus for SàT dev instance - core ##" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
163 dbus-monitor "sender='org.goffi.SAT', interface='org.goffi.SAT.core'" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
164 } |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
165 monitor_plugin() { |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
166 echo "## Monitoring DBus for SàT dev instance - plugin ##" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
167 dbus-monitor "sender='org.goffi.SAT', interface='org.goffi.SAT.plugin'" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
168 } |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
169 monitor_main() { |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
170 echo "## Monitoring DBus for SàT main instance (redirected to /tmp/...) ##" |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
171 killall -q dbus-monitor |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
172 nohup dbus-monitor "sender='org.goffi.sat_main', interface='org.goffi.sat_main.core'" >> /tmp/sat_xml_core_`date +%y.%m.%d`& |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
173 nohup dbus-monitor "sender='org.goffi.sat_main', interface='org.goffi.sat_main.plugin'" >> /tmp/sat_xml_plugin_`date +%y.%m.%d`& |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
174 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
175 case "$1" in |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
176 stop_lib) stop_lib ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
177 stop_sat) stop_sat ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
178 stop_ser) stop_ser ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
179 start_ser) start_ser ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
180 start_sat) start_sat ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
181 start_lib) start_lib ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
182 stop) stop_lib && stop_sat && stop_ser ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
183 start) start_ser && start_sat && start_lib;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
184 restart_sat) stop_sat && stop_ser && start_ser && start_sat ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
185 restart_lib) stop_lib && start_lib ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
186 4foxes) 4foxes ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
187 clean) clean ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
188 purge) clean && purge;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
189 main) main ;; |
18
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
190 bridge) bridge ;; |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
191 monitor_core) monitor_core ;; |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
192 monitor_plugin) monitor_plugin ;; |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
193 monitor_main) monitor_main ;; |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
194 *) |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
195 # default: reinstall and restart all |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
196 stop_lib && stop_sat && stop_ser |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
197 clean |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
198 start_ser && start_sat && start_lib |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
199 ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
200 esac |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
201 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
202 echo "Done." |