[Swift-commit] r3703 - trunk/bin

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sat Oct 30 16:33:13 CDT 2010


Author: davidk
Date: 2010-10-30 16:33:13 -0500 (Sat, 30 Oct 2010)
New Revision: 3703

Modified:
   trunk/bin/swift
Log:
Updated swift shell script to use bash sockets for usage tracking rather than 
netcat



Modified: trunk/bin/swift
===================================================================
--- trunk/bin/swift	2010-10-28 23:13:24 UTC (rev 3702)
+++ trunk/bin/swift	2010-10-30 21:33:13 UTC (rev 3703)
@@ -116,11 +116,11 @@
     SWIFT_USAGE_STATS=0
 fi
 
-NC=`which nc 2>&1`
-if [ ! -x "$NC" ]; then
-    NC=`which netcat 2>&1`
-    if [ ! -x "$NC" ]; then
-        echo "warning: unable to find nc"
+BASH="/bin/bash"
+if [ ! -x "$BASH" ]; then
+    BASH=`which bash 2>&1`
+    if [ ! -x "$BASH" ]; then
+        echo "warning: unable to find bash"
         SWIFT_USAGE_STATS=0
     fi
 fi
@@ -139,7 +139,7 @@
     USERID=`echo $USERID $HOSTNAME $MAC | $MD5SUM |cut -d ' ' -f1`
     DATE=`date`
     KEY=`echo $USERID $DATE $$ | $MD5SUM | cut -d ' ' -f1`
-    echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -w 10 -n -u $LISTENER $PORT &
+    $BASH -c "echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0 > /dev/udp/$LISTENER/$PORT" &
 fi
 
 ### EXECUTE ############
@@ -154,7 +154,7 @@
 return_code=$?
 
 if [ "$SWIFT_USAGE_STATS" = 1 ]; then
-	echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -w 10 -n -u $LISTENER $PORT &
+	$BASH -c "echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1 > /dev/udp/$LISTENER/$PORT" &
 fi
 
 exit $return_code




More information about the Swift-commit mailing list