-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·63 lines (60 loc) · 1.29 KB
/
start.sh
File metadata and controls
executable file
·63 lines (60 loc) · 1.29 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#/bin/bash
timeout_()
{
seconds="${1}"
msg_1="${2}"
msg_2="${3}"
for((i=0;i<=seconds;i++)); do
wait=$((seconds-i))
echo "${msg_1}${wait}${msg_2}"
sleep 1
done
}
timeout_std()
{
seconds="${1}"
timeout_ ${seconds} "Timeout: " " seconds"
}
screen_test()
{
name="${1}"
ret=$(echo $(screen -ls ${name} | cut -d$'\n' -f1 | cut -d':' -f1 | cut -d' ' -f1))
if [[ "${ret}" == "No" ]]; then
return 2
else
return 1
fi
}
screen -wipe 2> /dev/null 1>/dev/null
cd src
cd I2P
screen_test I2PHelper
echo "Wait 10 seconds to start the I2PHelper screen!"
timeout_std 10
screen_test I2PHelper
if [ $? -lt 2 ]; then
echo "I2PHelper screen already started!"
else
echo "I2PHelper screen started!"
screen -dmS I2PHelper python I2PHelper.py
fi
screen_test I2PSocksServer
if [ $? -lt 2 ]; then
echo "I2PSocksServer screen already started!"
else
echo "Wait 30 seconds in order to can start the I2PSocksServer screen"
timeout_std 30
echo "I2PSocksServer screen started!"
screen -dmS I2PSocksServer python I2PSocksServer.py
fi
cd ..
cd ..
screen_test ZeroNet
if [ $? -lt 2 ]; then
echo "ZeroNet screen already started!"
else
echo "Wait 30 seconds in order to can start the ZeroNet screen"
timeout_std 30
echo "ZeroNet screen started!"
screen -dmS ZeroNet python zeronet.py
fi