summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/cetonproxy
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-01-23 23:46:37 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-01-23 23:46:37 (GMT)
commit5fd9752d7444750a3bb4222ed15c8ddf6db858fe (patch)
tree1cfbbb9549297619387b1300acc622fd479eea4e /abs/core/runit-scripts/runitscripts/services/cetonproxy
parent879fd1c6e6a0fc060866f810956b00be2d1792cf (diff)
downloadlinhes_pkgbuild-5fd9752d7444750a3bb4222ed15c8ddf6db858fe.zip
linhes_pkgbuild-5fd9752d7444750a3bb4222ed15c8ddf6db858fe.tar.gz
linhes_pkgbuild-5fd9752d7444750a3bb4222ed15c8ddf6db858fe.tar.bz2
runit-scripts: add cetonproxy or bridge service. Added infinitv_usb service.
refs #899 refs #898
Diffstat (limited to 'abs/core/runit-scripts/runitscripts/services/cetonproxy')
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/cetonproxy/finish2
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/cetonproxy/run25
2 files changed, 27 insertions, 0 deletions
diff --git a/abs/core/runit-scripts/runitscripts/services/cetonproxy/finish b/abs/core/runit-scripts/runitscripts/services/cetonproxy/finish
new file mode 100755
index 0000000..4d4d6da
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/cetonproxy/finish
@@ -0,0 +1,2 @@
+#!/bin/bash
+/usr/bin/killall -9 balance
diff --git a/abs/core/runit-scripts/runitscripts/services/cetonproxy/run b/abs/core/runit-scripts/runitscripts/services/cetonproxy/run
new file mode 100755
index 0000000..c8c7fcf
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/cetonproxy/run
@@ -0,0 +1,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
+