-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathhost.sh
More file actions
executable file
·49 lines (36 loc) · 974 Bytes
/
host.sh
File metadata and controls
executable file
·49 lines (36 loc) · 974 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
44
45
46
47
48
49
#!/bin/bash
set -x
rootChannel=$1
token="dummytoken"
if [ $2 ]
then
token=$2
fi
# kill all child processes on exit
trap 'kill $(jobs -p)' EXIT
function hostFile {
local channel=$1
local path=$2
for workerId in {1..8}
do
echo "Starting worker $workerId for $path at $rootChannel$channel"
hostFileWorker $channel $path $workerId &
done
wait
}
function hostFileWorker {
local channel=$1
local path=$2
local workerId=$3
while true
do
curl -X POST -H "Authorization: Bearer $token" $rootChannel$channel --data-binary @$path 1>>./logs${channel}_stdout 2>>./logs${channel}_stderr
if [ "$?" -ne "0" ]; then
sleep 1
fi
done
}
hostFile /favicon.ico ./favicon.ico &
hostFile / ./index.html &
./apps/simple_chat/host.sh $rootChannel $token /apps/simple_chat &
wait