From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-24-ewr.dyndns.com (mxout-117-ewr.mailhop.org [216.146.33.117]) by lists.bufferbloat.net (Postfix) with ESMTP id 32F0B2E0532 for ; Wed, 6 Apr 2011 06:30:15 -0700 (PDT) Received: from scan-22-ewr.mailhop.org (scan-22-ewr.local [10.0.141.244]) by mail-24-ewr.dyndns.com (Postfix) with ESMTP id A02535D2D44 for ; Wed, 6 Apr 2011 13:30:14 +0000 (UTC) X-Spam-Score: 0.1 () X-Mail-Handler: MailHop by DynDNS X-Originating-IP: 143.225.229.147 Received: from svn.comics.unina.it (unknown [143.225.229.147]) by mail-24-ewr.dyndns.com (Postfix) with ESMTP id EBEA85D2C98 for ; Wed, 6 Apr 2011 13:30:08 +0000 (UTC) Received: from www-data by svn.comics.unina.it with local (Exim 4.69) (envelope-from ) id 1Q7SrQ-0007bS-GC for bismark-commits@lists.bufferbloat.net; Wed, 06 Apr 2011 15:33:28 +0200 To: bismark-commits@lists.bufferbloat.net From: bismark@svn.comics.unina.it Message-Id: Date: Wed, 06 Apr 2011 15:33:28 +0200 Subject: [Bismark-commits] rev 315 - trunk/device/OpenWrt_common/scripts X-BeenThere: bismark-commits@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2011 13:30:15 -0000 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