diff options
| author | Joseph Henry <josephjah@gmail.com> | 2015-11-09 19:37:19 -0800 |
|---|---|---|
| committer | Joseph Henry <josephjah@gmail.com> | 2015-11-09 19:37:19 -0800 |
| commit | 19f09e46faaee6e2cfe52221e3e01946d31692f3 (patch) | |
| tree | 44b0df666a001419a6fbd14775fcc079f2a64bab /docker-test/throughput/intercept | |
| parent | 134ad8ac21711422ae55eb74b6130c6d036c9ade (diff) | |
| download | infinitytier-19f09e46faaee6e2cfe52221e3e01946d31692f3.tar.gz infinitytier-19f09e46faaee6e2cfe52221e3e01946d31692f3.zip | |
Moved/Renamed Docker test dirs
Diffstat (limited to 'docker-test/throughput/intercept')
| -rwxr-xr-x | docker-test/throughput/intercept | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/docker-test/throughput/intercept b/docker-test/throughput/intercept new file mode 100755 index 00000000..3eb27ff7 --- /dev/null +++ b/docker-test/throughput/intercept @@ -0,0 +1,54 @@ +#!/bin/sh +# usage: +# /usr/bin/intercept program <args> + +if [ $# = 0 ] ; then + echo "$0: insufficient arguments" + exit +fi + +case "$1" in + on) + if [ -z "$LD_PRELOAD" ] + then + export LD_PRELOAD="/lib/libintercept.so.1.0" + else + echo $LD_PRELOAD | grep -q "/lib/libintercept\.so.1.0" || \ + export LD_PRELOAD="/lib/libintercept.so $LD_PRELOAD" + fi + ;; + off) + export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\/lib\/libintercept.so.1.0 \?//'` + if [ -z "$LD_PRELOAD" ] + then + unset LD_PRELOAD + fi + ;; + show|sh) + echo "LD_PRELOAD=\"$LD_PRELOAD\"" + ;; + -h|-?) + echo "" + ;; + *) + if [ -z "$LD_PRELOAD" ] + then + export LD_PRELOAD="/lib/libintercept.so.1.0" + else + echo $LD_PRELOAD | grep -q "/lib/libintercept\.so.1.0" || \ + export LD_PRELOAD="/lib/libintercept.so.1.0 $LD_PRELOAD" + fi + + if [ $# = 0 ] + then + ${SHELL:-/bin/sh} + fi + + if [ $# -gt 0 ] + then + exec "$@" + fi + ;; +esac + +#EOF |
