summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/cetonproxy/run
blob: c8c7fcf32db1c9fab3764784b3173b7d84578dc5 (plain)
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
#!/bin/bash
exec 2>&1
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions
stat_runit "Starting Ceton bridge"
pid_string=''

for i in `ls /etc/ceton_proxy.d/|sort -r`
do
    . /etc/ceton_proxy.d/$i
    #forcing foreground and then running with & is to capture the pid
    balance -f $port $ip:80  >/dev/null &
    stat_runit "    proxy $ip on port $port"
    pid=$!
    pid_string="$pid_string $pid"
done

if [ "x$pid_string" = "x" ]
then
    sv stop cetonproxy
else
    wait $pid_string
fi