-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathejecuta.sh
More file actions
executable file
·44 lines (36 loc) · 873 Bytes
/
Copy pathejecuta.sh
File metadata and controls
executable file
·44 lines (36 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/bash
function check {
if [ $? -eq '0' ]; then
echo " [OK]";
else
echo " [ERROR]";
exit 1;
fi;
}
cd ./bin
echo -n "Lanzando rmiregistry"
if [ `ps aux | grep rmiregistry | wc -l` -eq '2' ]; then
echo " [ALREADY]"
else
rmiregistry &
check;
fi
direc=$(pwd);
echo -n "Generando stub del servidor"
rmic servidor.TwitterInitImpl
check
echo -n "Generando el stub del cliente"
rmic cliente.ClientCallbackListener
check
echo -n "Lanzando servidor";
java -Djava.rmi.server.codebase=file:///${direc}/servidor/ -classpath ../libs/*:./ servidor.TwitterInitImpl &
PIDSERV="$!";
check
echo "Lanzando cliente";
sleep 1;
java -Djava.rmi.server.codebaseile:file///${direc}/cliente/ -classpath ../libs/*:./ cliente.TwitterClient
PIDCLI="$!" &
check
echo -n "Finalizando servidor";
kill -9 $PIDSERV;
check