#!/bin/bash set -e$JWRAP_SCRIPT_X unwire () { ldp="$LD_PRELOAD:" ldp2='' while [ "x$ldp" != x ]; do this="${ldp%%:*}" ldp="${ldp#*:}" case "$this" in *libjwrap*.so.*) ;; *) ldp2="$ldp2$this:" ;; esac done if [ "x$ldp2" != x ]; then LD_PRELOAD="${ldp2%:}" else unset LD_PRELOAD fi unset JWRAP_SCRIPT } echo ":$*" path="$1"; shift arg0="$1"; shift args=( "$@" ) nargs=${#args[*]} lastarg="${args[$(( $nargs - 1 ))]}" fail () { echo >&2 "jwrap-script: $*" exit 127 } if [ x"$lastarg" = x"com.threerings.yohoho.client.YoApp" ]; then case "$path" in */bin/java) ;; *) fail "unexpected path format $path" ;; esac [ x"$JWRAP_EXTDIR" != x ] || fail 'JWRAP_EXTDIR not set' extdirs="$JWRAP_EXTDIR:${path%/bin/java}/lib/ext" set -e$JWRAP_SCRIPT_X -- \ -Djavax.accessibility.assistive_technologies=com.tedpearson.ypp.market.MarketUploader \ -Djava.ext.dirs="$extdirs" \ "$@" unwire fi exec -a "$arg0" /dev/jwrap/bypass "$path" "$@"