From: bismark@svn.comics.unina.it
To: bismark-commits@lists.bufferbloat.net
Subject: [Bismark-commits] rev 315 - trunk/device/OpenWrt_common/scripts
Date: Wed, 06 Apr 2011 15:33:28 +0200 [thread overview]
Message-ID: <E1Q7SrQ-0007bS-GC@svn.comics.unina.it> (raw)
Author: bismark
Date: 2011-04-06 15:33:28 +0200 (Wed, 06 Apr 2011)
New Revision: 315
Modified:
trunk/device/OpenWrt_common/scripts/action
trunk/device/OpenWrt_common/scripts/probe
Log:
OpenWrt_i586 probe/action porting
Modified: trunk/device/OpenWrt_common/scripts/action
===================================================================
--- trunk/device/OpenWrt_common/scripts/action 2011-04-06 12:41:16 UTC (rev 314)
+++ trunk/device/OpenWrt_common/scripts/action 2011-04-06 13:33:28 UTC (rev 315)
@@ -19,8 +19,10 @@
case $1 in
fwd) # on-demand SSH tunnel
if [ $2 == ${2#*:} ]; then
+ # Default to local port 22
( ssh $KEEP_ALIVE -N -i $SSH_KEY -R $2:127.0.0.1:22 $USER@$SERVER >/dev/null 2>&1 & )
else
+ # To custom IP:PORT destination
( ssh $KEEP_ALIVE -N -i $SSH_KEY -R $2 $USER@$SERVER >/dev/null 2>&1 & )
fi
;;
Modified: trunk/device/OpenWrt_common/scripts/probe
===================================================================
--- trunk/device/OpenWrt_common/scripts/probe 2011-04-06 12:41:16 UTC (rev 314)
+++ trunk/device/OpenWrt_common/scripts/probe 2011-04-06 13:33:28 UTC (rev 315)
@@ -9,7 +9,7 @@
# author: walter.dedonato@unina.it
# Load configuration file
-. ~/conf/dev.conf
+. $BISMARK_DIR/etc/bismark.conf
# Probe message generator
msg () {
@@ -18,19 +18,16 @@
return 0
}
-# Launch startup script during boot
-[ -e /tmp/faults ] || startup
-
# Create status files
-[ -e /tmp/faults ] || echo 0 > /tmp/faults
-[ -e /tmp/proxy ] || echo 0 > /tmp/proxy
+[ -e $BISMARK_DIR/var/faults ] || echo 0 > $BISMARK_DIR/var/faults
+[ -e $BISMARK_DIR/var/proxy ] || echo 0 > $BISMARK_DIR/var/proxy
# Check faults count
-faults=$(cat /tmp/faults)
+faults=$(cat $BISMARK_DIR/var/faults)
if [ $faults -ge 20 ]; then
proxy=$(cat /tmp/proxy)
- echo $(( (proxy + 1) % 2 )) > /tmp/proxy
- echo 0 > /tmp/faults
+ echo $(( (proxy + 1) % 2 )) > $BISMARK_DIR/var/proxy
+ echo 0 > $BISMARK_DIR/var/faults
faults=0
fi
@@ -38,10 +35,10 @@
sleep $((RANDOM % 30))
# Send probe and store reply
-if [ $(cat /tmp/proxy) -eq 1 ]; then
- msg | nc -u $NC_OPTS $PROXY $PROXY_PORT > /tmp/reply
+if [ $(cat $BISMARK_DIR/var/proxy) -eq 1 ]; then
+ msg | nc -u $NC_OPTS $PROXY $PROXY_PORT > $BISMARK_DIR/var/reply
else
- msg | nc -u $NC_OPTS $SERVER $PROBE_PORT > /tmp/reply
+ msg | nc -u $NC_OPTS $SERVER $PROBE_PORT > $BISMARK_DIR/var/reply
fi
# Refresh faults count
reply other threads:[~2011-04-06 13:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1Q7SrQ-0007bS-GC@svn.comics.unina.it \
--to=bismark@svn.comics.unina.it \
--cc=bismark-commits@lists.bufferbloat.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox